Confirm the ending bug

Confirm the ending bug
0

#1

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?


#2

Please upload the challenge name and link.


#3

Confirm The Ending


#4

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.


#5

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.


#6

What bug are you talking about?


#7

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


#8

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.


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