"yourName".length Error message: Oops, try again. Did you write 'yourName'.length correctly?


#1

The name was Lopes; so I typed: "yourName".length

Error message: Oops, try again. Did you write 'yourName'.length correctly?
Well, I don`t know!

»»»»»»»»
To discover the length of your name write your name within quotes. Then write a period (full stop) and the word length like this:
"yourName".length


#2

I typed : "Lopes".lenght
I saved & submitted;
error: Oops, try again. Did you write 'yourName'.length correctly?


#3

Re-check your spelling. You spelt length as lenght. And remember the semicolon ( ; ).

Should be:

"Lopes".length;

#4

I have the same problem, don't find a mistake..


#5

Copy & paste your code here or create a new topic.
It'll better help us debug your code.


#6

problem solved, thanks anyway!


#7

Here is my code:

// On line 2, declare a variable myName and give it your name.
var myName = "Tyron"
// On line 4, use console.log to print out the myName variable.
console.log( myName.length);
// On line 7, change the value of myName to be just the first 2
// letters of your name.
console.log( myName.substring(0,2));
// On line 9, use console.log to print out the myName variable.
console.log

This is the error message : Oops, try again. It looks like you didn't log your whole name to the console.

Can anyone help me please, I am lost


#8

Hi Tyron,

You have line 2 correct, but I think on line 7 it should be:

var myName = "Ty"

and then lines 4 and 9 should both say:

console.log(myName);

I think the point of this lesson is to show that the computer reads the code in order, so it will first show your name as Tyron, but then when it changes later it will show it as Ty. I was also stuck on this lesson and your post showed me that I forgot to put "" around my name. So thanks!