how do i end something if it ends with a string 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;
}