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 = lastName.lenght;
console.log(lastNameLength)

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

Challenge: Basic JavaScript - Find the Length of a String

Link to the challenge:

Hi there and welcome to our community!

You have a typo:

lastName.lenght

what i didnt get…
its saying undefined , i even watched on internet
its a error in code ig

Did you fix the typo?

yess but its not its .lenght right???

No, that’s not how to spell ‘length’

then how to spell it in code

You spell it the way I just spelled it…

1 Like

plzz can u elaborate

I literally typed the correct spelling here. I’m honestly not sure how to be more clear on how to spell ‘length’? I’ve got it twice here now, lol


this is the error

Stop. Touch the letters on the screen. You are not using the spelling ‘length’

Every single letter has to match or JavaScript won’t understand you. This is a super common misspelling

ooohhhhhh!!! got it i copied ur spelling and it wirks man thanks aloooooooooot u r soooo goood sirrrr

1 Like

‘length’ is one of my least favorite coding words. So easy to typo

1 Like

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