Basic JavaScript - Find the Length of a String

Tell us what’s happening:
Describe your issue in detail here.
Hi I can’t see what else needs to be added
Your code so far

// Setup

let lastNameLength = 0;

const lastName = “Lovelace”;

// Only change code below this line

lastNameLength = lastName;

console.log(lastName.length);

// 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/107.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Find the Length of a String

Link to the challenge:

hi there,

which line of code do you believe completes this requirement from the exercise?

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

It seems to be the last one

this is the last one you believe will “set lastNameLength to the number of characters in lastName”?

Thats what I was thinking

What about this line? How would you describe what it does?

I can’t get my head around it quite yet

perhaps review this topic first then get back to me?

Is lastNameLength = lastName not checking the number of characters in Lovelace .ie the lastname

What part of that is finding the length of the string?

I solved it Thanks for the guidance

1 Like

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