check end of string of 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;
}