Tell us what’s happening:
Describe your issue in detail here.
Your code so far
can anyone kindly help a begginer?
let lastNameLength = 0;
const lastName = "Lovelace";
// Only change code below this line
lastNameLength = lastName.lenght;
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.96.36.199 Safari/537.36
Link to the challenge:
You should be receiving a message about a syntax error here. You have a typo.
It doesn’t actually throw any errors. It just gives you
undefined for the property that doesn’t exist.
It is such a common typo as well.
Rude, I would expect something more obvious.
It is a feature, not a bug.
TypeScript would definitely yell at you, and it even has a helpful error message.
Property ‘lenght’ does not exist on type ‘“Lovelace”’. Did you mean ‘length’?
Yeah, I understand why its there and how it’s baked into JS deeply - I just don’t like it
I’m used to the beautiful world of compiled languages, lol
JS doing JS things, what can you do? But I agree, it isn’t very helpful in this case.
Well, until you have to wait 4 hours for a compilation. Then it starts to get old pretty fast.