I cant see what Im doing wrong,flew through the last 2 lessons but i have become stuck on this

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
lastName = "hotcakes";
lastName.length

Your browser information:

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

Challenge: Find the Length of a String

Link to the challenge:

I have changed it to lovelace but nothing changed,thought that might be the problem lol

You add the .length to a string, to get the length of the string as a number. You are supposed to save that number in lastname.length
You however counted the lettes yourself and hardcoded that.

1 Like
// Setup

let lastNameLength = 0;

const lastName = "Lovelace";

// Only change code below this line

lastNameLength = 0;

lastName = "lovelace";

lastName.length.

sorry but Im confused on this one

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

I would reset the lesson.

Your answer should only be one line of code.
If you are adding more lines of code than that, then it is incorrect.

You should be changing this line here

// Only change code below this line
lastNameLength = lastName;

Use the length property on the lastName variable.

Hope that helps!

1 Like

I was overcomlpicating it totally, it was so easy when i took a minute to think about it

Thank you,I was adding in unnecessary text,pretty easy after all that