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:
hbar1st
2
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
hbar1st
4
this is the last one you believe will “set lastNameLength to the number of characters in lastName”?
Thats what I was thinking
hbar1st
6
What about this line? How would you describe what it does?
I can’t get my head around it quite yet
hbar1st
8
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