Find the Length of a String

Find the Length of a String
0

#1

Hi please help me

My code

var firstNameLength = 0;
var lastNameLength = 8;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastName=lastName.lenght;




Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36.

Link to the challenge:


#2

lastName=lastName.lenght;
is not equal to
lastName=lastName.length;

just a little typo


#3

Check your spelling! Happens more often than you’d think :wink:


#4

Hi there,
Guys, I need some help from you.
I have tried this and doesn’t work. Would you help me on this issue and telling me what i’m doing wrongly?

// Example
var firstNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

// Setup
var lastNameLength = 8;
var lastName = "LastName";

// Only change code below this line.
var lastNameLength = 8;
var lastName = "lastName";
lastNameLength = lastName.length;

#5

I’ve edited your post for readability. When you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard.

The original code for the challenge is as follows:


// Example
var firstNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

// Setup
var lastNameLength = 0;
var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName;

You only need to change the last line of code. Don’t change any of the other lines.