Use Bracket Notation to Find the NthtoLast Charactter in a String

Use Bracket Notation to Find the NthtoLast Charactter in a String
0

#1

Tell us what’s happening:

Your code so far

// Example
var firstName = "Ada";
var thirdToLastLetterOfFirstName = firstName[firstName.length - 3];

// Setup
var lastName = "Lovelace";

// Only change code below this line
var secondToLastLetterOfLastName = lastName[lastName.length - 3];


Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36.

Link to the challenge:


#2

You’re really close! Notice how the test is asking for the seconds to last letter, and adjust the number in secondToLastLetterOfLastName accordingly. Good luck!