Confirm the Ending challenge, only one string left, please help

Confirm the Ending challenge, only one string left, please help
0

#1

Hello! I’ve done everything except one. Can’t understand, why it doesn’t work. Please check.
Result
My code

function confirmEnding(str, target) {
  if (str.substr(-1) === target.substr(-1)){
    return true;
  }
  else return false;
  
}

confirmEnding("Bastian", "n");

#2

You’re only comparing the last letters of the str and target strings. It returns true if you entered 'bastion' and 'an' (because they end with the same letter), but it should really return false.


#3

I got this, thank you very much.