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

Tell us what’s happening:

Your code so far


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

firstLetterOfFirstName = firstName[0];

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

// Only change code below this line
var firstLetterOfLastName = lastName[lastName.length-1];


Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-first-character-in-a-string

You have found the last letter of lastName.

Use the index of the first letter as in the example in the code.