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

What do I do wrong if it says:
// running tests The

thirdLetterOfLastName

variable should have the value of
v
. You should use bracket notation. // tests completed // console output ReferenceError: v is not defined

Your code so far

// Setup
const lastName = "Lovelace";

// Only change code below this line
const thirdLetterOfLastName = [v]; // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

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

Link to the challenge:

The brackets should have the index of the letter.

Please reread the exercise

The example given in the challenge demonstrates how to find the second letter of any given string:

const firstName = "Ada";
const secondLetterOfFirstName = firstName[1];

Zero-based indexing means that the first index of a string is string[0], the second string[1], etc…

So to find the third letter of the string lastName…?

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