Tell us what’s happening:
Your code so far
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
var a = str.substring((str.lengt-1)-target.length);
if (a == target){
return true;
} else {
return false;
}
}
confirmEnding("Bastian", "n");
Link to the challenge: