I am quite sure that the code is right but the site says it´s wrong answer

I have already seen the videos and the hint to be sure the code was right am i missing something here or it’s really a bug?

Your code so far


// Setup
const lastName = "Lovelace";

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

Challenge: Use Bracket Notation to Find the Nth-to-Last Character in a String

Link to the challenge:

Hi @joaopamaro7 !

You have two issues

No.1:
This is spelled wrong

No.2:
You should add a console.log(secondToLastLetterOfLastName) at the end of your code to see what you are actually returning.

You will see that you are returning the wrong letter.
That means you need to adjust the number here

1 Like

i am dumb sorry
thank you for helping me

We all make typos here and there… it’s why a ‘second set of eyes’ is so powerful. These challenges are meant to trip you up in the very ways that you struggle. Don’t be discouraged when you are having trouble, be discouraged when it’s too easy.

2 Likes

Thank you, I am continuing to learn and this comment helped me keep it up with it, really, thank you

1 Like