Confirm the Ending - returns true, but system won't acknowledge that

Tell us what’s happening:

I’m not sure if this is a problem with my code, or a problem with the system. According to what’s coming up in the output window, this code works; input that should return true does; input that should return false does. However, I’ve got red symbols next to all the “return true” requirements. Has anyone else run into this? Thanks in advance.

Your code so far

function confirmEnding(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  num = target.length;
  last = str.substring(str.length - num);
  if (last == target) {
    return "true";
  return false;

confirmEnding("Open sesame", "same");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8.

Link to the challenge:

Take a look at your return statements again. You want to return Boolean values. One of yours is not a Boolean value.

1 Like

Oh my gosh, I can’t believe I did that, and that I didn’t see it. Talk about a basic mistake. Thank you so much!

It happens to everyone. Don’t sweat it.:smile: