Dark Mode
Enable Console
strEnd('','')
/*
Compares ending of a string with a different string
Returns true if the ending matches the passed in string
*/
strEnd("codewars","rs");
// true
strEnd("codewars","r");
// false
Solution by - Need4Swede
function strEnd(str, ending){
// If value of 'str' ends with value of 'ending', returns true
return str.endsWith(ending);
}
Try it yourself - Codewars Source