it’s Not working for those 2 cases…need HeeeeLP!!!
confirmEnding(“Bastian”, “n”) should return true.
confirmEnding(“He has to give me a new name”, “me”) should return true.
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
strSplit=str.split(" ");
strEndPosition=(strSplit.length-1);
if(strSplit[strEndPosition]===target){
return true;}
else {
return false;}
}
confirmEnding("Bastian", "n");