Confirm the Ending- help me pls

Confirm the Ending- help me pls
0

#1

Tell us what’s happening:

Your code so far


function confirmEnding(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  var a = str.substring((str.lengt-1)-target.length);
  if (a == target){
    return true;
  } else {
    return false;
  }
}

confirmEnding("Bastian", "n");

Link to the challenge:


#2

You made a typo: str.lengt


#3

i updated the code
where is problem now?


#4

Check the value of a.


#5

You still have a typo on the following line:

var a = str.substring((str.lengt-1)-target.length);

#6

ty guys
Love freeCodeCamp and u especially <3