Confirm Ending on js

Tell us what’s happening:

Your code so far


function confirmEnding(str, target) {
var str2 = str.concat(“test”);
var split = str2.split(target);

if (split[split.length-1]===“test”) {return true;}
else {return false;}

}



console.log(confirmEnding("Bastian", "n"));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0.

Challenge: Confirm the Ending

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

Hello there @godwinchuks,

You didn’t tell us what you’re having a problem with on the Tell us what’s happening: section. Next time, please describe what you’re having a problem with.

you have a syntax error because you can’t use tilted or smart quotes, “” as you did around the word test , instead you need to use double quotes "" or single quotes ''

1 Like