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

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");

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.

1 Like

I got this, thank you very much.