Hello,
I have thought of a solution for this challenge using regexes and it seems to return only false.
I would like to better understand why this is happening. What am i missing ?
Your code so far
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
let strArr = str.split("");
let targetArr = target.split("");
return /targetArr$/.test(strArr);
}
confirmEnding("Bastian", "n");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.84
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending