Use Bracket Notation to Find the First Character in a String

Use Bracket Notation to Find the First Character in a String
0

#1

Tell us what’s happening:

Your code so far

// Example
var firstLetterOfFirstName = "";
var firstName = "Ada";

firstLetterOfFirstName = firstName[0];

// Setup
var firstLetterOfLastName = "";
var lastName = "Lovelace";

// Only change code below this line
firstLetterOfLastName = lastName;


Your browser information:

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

Link to the challenge:


#2

you didn’t use brackets.

firstLetterOfLastName = lastName;

firstLetterOfLastName = lastName[0];