You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
function endsWith(input, string) {
|
|
var index = input.length - string.length;
|
|
return index >= 0 && input.indexOf(string, index) > -1;
|
|
}
|
|
console.log(endsWith('JS string exercises', 'exercises')); |