Tell us what’s happening:
What is wrong with this code??
when ever i type the code it does not accept it, but if I find a solution and paste it it runs perfectly…why is that??
Your code so far
var secondToLastLetterOfLastName = lastName[lastName.lenght-2];
// Setup
var lastName = "Lovelace";
// Only change code below this line
var secondToLastLetterOfLastName = lastName[lastName.lenght-2];
// Change this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75
.
Challenge: Use Bracket Notation to Find the Nth-to-Last Character in a String
Link to the challenge: