freeCodeCamp Challenge Guide: Use Bracket Notation to Find the First Character in a String

freeCodeCamp Challenge Guide: Use Bracket Notation to Find the First Character in a String
0

#1

Bracket notation is a way to get a character at a specific index within a string.

Computers don’t start counting at 1 like humans do. They start at 0.

firstLetterOfLastName = lastName[0];

#2

For this exercise is necessary use the bracket notation

for exemple
// Example
var firstLetterOfFirstName = “”;
var firstName = “Ada”;

firstLetterOfFirstName = firstName[0];

The Answer is = “A”

\the Answer of this exercise

var firstLetterOfLastName = “”;
var lastName = “Lovelace”;

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

firstLetterOfLastName = lastName[0]; —> the bracket notation use the var LastName to found letters;


#3

This is what I got

var firstLetterOfLastName = “lastName”;

var firstLetterOfLastName = lastName[0];