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

0 points
Submitted by James Floretta
over 8 years

Q27

On line 1, create a variable myColor and give it a string value. On line 2, print the length of myColor to the console.

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

Oops, try again. It looks like you didn’t print the length myColor to the console!

I’ve tried leaving out the = in the second line. Ive tried refreshing the browser but nothing is working. It does however print 4 to the console.

Answer 5599d1069113cb70540002e2

1 vote

Permalink

The console.log should definitely NOT have an equals sign!.

points
over 8 years

Answer 559aff23e39efece79000693

1 vote

Permalink

just adding to the Smoshy’s answer try console.log(myColor.length)

points
Submitted by Nippun
over 8 years