Tell us what’s happening:
i m trying str.substring(i, str.length) === target , i have no idea why its gone heywired
Your code so far
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
for (var i = 0; i < str.length; i++) {
if (str.substring(i, str.length) === target){
return true;
} else {
return false;
}
}
}
confirmEnding("Bastian", "n");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/confirm-the-ending