Basic JavaScript - Find the Length of a String

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

Your code so far

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

// Only change code below this line
lastNameLength = 8;
lastNameLenght = lastName.Lenght

Your browser information:

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

Challenge: Basic JavaScript - Find the Length of a String

Link to the challenge:


The name of the property on a string that gives you the length of a string is called length. That’s all lowercase. And you should be sure you aren’t mixing up the order of the t and the h. It’s an easy mistake to make.

You do not want to add any new lines of code. I would restart the lesson to get the starting JS back. The only thing you want to do is modify the last line so that you are setting lastNameLength to the length of the string stored in lastName.

Thank you very much!

Mod edit: removed code

Please don’t post complete working code solutions in here. Rather than just giving the answer, we try to guide the person to find the answer on their own.

I apologize - you are right, 'twas stupid of me and not helpful at all. But I was so excited myself to have an answer for once instead of a ton of questions, I didn’t see other replies until I had posted mine.

My reply should have been:

“Simply read the challenge carefully.”

Sorry again …

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