Confirm the ending bug

In this challenge, it is given in instruction to not use built-in .endsWith() method. But using that also finishes the challenge. Can I work through this bug and resolve it or is it intended by the community?

Please upload the challenge name and link.

Confirm The Ending

The instructions state that it is known that you an use ES5 function endsWith() to complete the challenge, but they want you to learn how to use substring. Write them both, comment out the ES5 solution with a note about why, and then you will be able to go back and see two solutions to a problem if you ever need to return to a similar situation.

It’s not the solution i want. If that is so i would have posted in guide category. I want to resolve the bug for freecodecamp.

What bug are you talking about?

When I used endswith method all tests are passed. hence checking of use of endswith in code is not working.

You can submit a GitHub Issue to fix this test, if there isn’t one already. The bug in no way will impact your progress.

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

confirmEnding("Congratulation", "on");
1 Like