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

Tell us what’s happening:
Describe your issue in detail here.

**// Setup
let firstLetterOfLastName = “”;
const lastName = “Lovelace”;

Hello friend can you help please with this challenge, the system still saying, the variable should have the value of L.
Thanks

// Only change code below this line
lastName = “Lovelace”;
firstLetterOfLastName = [L]; Your code so far**

// Setup
let firstLetterOfLastName = "";
const lastName = "Lovelace";

// Only change code below this line
lastName = "Lovelace";
firstLetterOfLastName = [L]; 

Your browser information:

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

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

Link to the challenge:

The following code line is given by default in this challenge:

firstLetterOfLastName = lastName; // Change this line

Your task is to add the index (position) of the first letter in the “Lovelace” (which is the value assigned to the lastName variable) to the variable firstLetterOfLastName.

Follow the example given in the instruction:

const firstLetter = firstName[0];  

Thank you DobarBREND the challenge is solved.

1 Like

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