This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Peynauda
over 9 years

Javascript 27/28 , not sure if my mistake, or a bug

Hello The task asked is :

line 3 : create a variable called myColor and pick a value for it, as a text line 4 : Display its length in the console.

so i did this :

var myColor = “blue”; console.log(myColor.length);

In the console, i do see a “4” but i cant get to the next step, it says i dont display the length in the console.

Answer 54497aa69c4e9d352c0000b6

1 vote

Permalink

Your code is fine. Try refreshing your browser.

points
Submitted by Neil
over 9 years

Answer 5500c7179113cb13f500141b

0 votes

Permalink

This finally worked for me… which took a lot of trying and retrying. I thought variables didn’t use quotes… I must have mis-learned something, because this worked:

var myColor = (“blue”) console.log(myColor.length);

points
Submitted by ADarvai
about 9 years

1 comments

Neil about 9 years

(“blue”) doesn’t need parentheses.

Answer 544d3a778c1ccc27e200090c

-1 votes

Permalink

**you forgot the parenthesis around “myColor” line 2

points
Submitted by Janeen0605
over 9 years

1 comments

Neil over 9 years

myColor does have parentheses around it on line 2. Do you mean quote marks? If so, variables NEVER have quotes around them.