Use Bracket Notation to Find the NthtoLast Character in a String (Not sure why it isn't working?)

Use Bracket Notation to Find the NthtoLast Character in a String (Not sure why it isn't working?)
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[firstName.length - 5];

Your browser information:

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

Link to the challenge:


#2

You should use the length of lastName, not of firstName.


#3

I understand now! Oh dear - pardon my algorithm reading