Confirm the Ending (javascript)

Confirm the Ending (javascript)
0.0 0


I am now at Basic algorithm Scripting in (

here is my code:

function confirmEnding(str, target) {
var str2 = str.substr(str.length -1 , 1);
var target2 = target.substr(target.length - 1 , 1);
return str2 === target2;
confirmEnding(“Walking on water and developing software from a specification are easy if both are frozen”, “specification”);

freecodecamp says that this argument should return false whereas the challenge says it should return true.

what is wrong with my code to make this return false? I am very confused.


Where do you get the conflicting information from?
"oth are frozen” != “specification”, that’s why your code returns the wrong result.