check if end of string is equal to something js code example
Example: how to compare a string with its ending in javascript
function solution(str, ending){
return str.indexOf(ending, str.length - ending.length) !== -1;
}
function solution(str, ending){
return str.indexOf(ending, str.length - ending.length) !== -1;
}