Syntax error on lesson 27 pt. 1. HELP!


#1

There is a syntax error on JavaScript lesson 27.

My code:

var "myColor" = blue;
console.log("myColor".length);;

Please help!


#2

myColor is a variable name so you don't need " " to create.
but blue is a srting value so you need " " there

so same for console.log.

console.log(myColor.length); //myColor is a variable name

but for blue

console.log("blue".length); //blue is a string value


#3

The instructions specify "make it as string"..so yes you do need quotation marks


#4

Thanks! I figured it out.


#5

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