Basic JavaScript - Find the Length of a String

Tell us what’s happening:
I Don’t know what is the error? but I do the instructions

Your code so far

// Setup
let lastNameLength = 0;
const lastName = "Lovelace";

// Only change code below this line
lastNameLength = lastName;
console.log(lastName.length);

Your browser information:

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

Challenge: Basic JavaScript - Find the Length of a String

Link to the challenge:

1 Like

This is in the instructions:
For example, if we created a variable const firstName = "Ada" , we could find out how long the string Ada is by using the firstName.length property.


Use the .length property to set lastNameLength to the number of characters in lastName.

Read once more…

1 Like