Tell us what’s happening:
i have no idea why it doesn’t work !
Your code so far
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
var nwstr = str.split("");
if ( str.substr(nwstr.length-1-target.length , nwstr.length-1 ) === target)
{
return true;
}
return false;
}
confirmEnding("Bastian", "n");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/confirm-the-ending