Basic JavaScript - Find the Length of a String

i dont get it pls someone explain
You should be getting the length of lastName by using .length like this: lastName.length

Your code so far

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

// Only change code below this line
lastNameLength = (lastName.length);
console.log(lastNameLength);
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/109.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Find the Length of a String

Link to the challenge:

It is syntax issue, no need for parenthesis here

1 Like

Hello!!
I have inverted a lot of time in this question
My resumen is:

let VARIABLE = X
const CONSTANT= “Abracadabra”

VARIABLE= CONSTANT.length;

Is this code ok?
Thank you for your help, guys!!

Your code is close, the only change is to initialize VARIABLE to 0 not X. After changing that it should work.

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