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

0 points
Submitted by GenomVoid
over 9 years

Conclusion part 1

This is my code: var myColor = “Black”; console.log (“myColor”.length); Yet I keep getting errors. What is wrong with it?

Answer 544ef8508c1cccb74d000706

1 vote

Permalink

"myColor"

NEVER, EVER put quotes around a variable. Quotes are for strings.

Your code console.log ("myColor".length); will print 7 because that’s how many characters “myColor” has.

points
Submitted by Neil
over 9 years