/..

Dark Mode

Enable Console

The Function

strEnd('','')
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

How it works

function strEnd(str, ending){

  // If value of 'str' ends with value of 'ending', returns true
  return str.endsWith(ending);

}

Try it yourself - Codewars Source

You can also use my built-in JavaScript console