Basic JavaScript - Use Bracket Notation to Find the Nth Character in a String

It’s asking me for the third letter of the lastname using bracket notation. I seem to have done it correctly and yet it says it’s wrong. Is this a glitch or am I truly doing it incorrectly?

Your code so far

/,xz.// Setup
const lastName = "Lovelace";

// Only change code below this line
const thirdLetterOfLastName = lastName[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/104.0.0.0 Safari/537.36

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

Link to the challenge:

do you have this in your actual code for solution? it’s the only problem i see

1 Like

yea that was the problem. i just got rid of it and it works now. It’s weird tho because it says “only change the code below this line” and /,xyz. is well above the line

Sure, but is that a valid comment character? If it isn’t, that is a syntax error that prevents every following line from running.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.