Intermediate algorithm

Tell us what’s happening:
Anyone else going through the intermediate algorithm section looking through the hint and solution and not being able to solve anyone by yourself. Is this okay or even normal?

Your code so far


function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor

return str.slice(-1) === target.slice(-1);
}

confirmEnding("Bastian", "n");

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36.

Challenge: Confirm the Ending

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending

it is normal to find stuff hard at first, keep grinding, return later to the stuff you have not been able to complete on your own, keep grinding

anyway, your solution will fail this, can you figure out why?
confirmEnding("Bastian", "on");

you can tweak your solution just a tiny bit and it will work in any case

If you feel like you had to look at the solution to every challenge, you might want to spend some more time on this section. If you go back to the challenges a second time, are you able to complete them without looking at the hints? If not, I suggest going through the section again from the beginning without the solutions. Feel free to come here on the forum and ask for help. We will try to give you small nudges rather than just tell you the answer, so that you can actually work through the process of problem solving.