i completed this tests
confirmEnding("Walking on water and developing software from a specification are easy if both are frozen", "specification") should return false.
but there is a challenge same as this one that isnt checking,there are two identical tests but one is completed and one is not.This one involves many tests so i cant post them here but only four tests are left .
Is there any problem with my code?
Your code so far
function confirmEnding(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
let num = target.length;
let num1 = str.length;
let arr = str.split('');
if (arr[arr.length-target.length] == target)
{str = true;}
else{
str = false;
}
return str;
}
confirmEnding("Bastian", "n");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/confirm-the-ending/