Answers for "how to check if something ends in number javascript"

1

endswith()

var str = "Hello world, welcome to the universe.";
var n = str.endsWith("universe.");//returns true
Posted by: Guest on May-03-2020
0

how to compare a string with its ending in javascript

function solution(str, ending){
  return str.indexOf(ending, str.length - ending.length) !== -1;
}
Posted by: Guest on March-23-2020

Code answers related to "how to check if something ends in number javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language