Basic JavaScript: Use Bracket Notation to Find the Nth-to-Last Character in a StringPassed

Hi everybody! I have a problem

// Setup
var lastName = "Lovelace";

// Only change code below this line
var secondToLastLetterOfLastName = [lastName.lenght - 2]; // Change this line

With this part of Basic Javascript and I don’t know why it’s not work. It supose to give me the letter “c”. Please help

you spelled length wrong

Oh, I see. I change it but still without work

change it to lastName[lastName.length - 2]

1 Like

:D! it works! thank you!

change to lastName[lastName.length -2]