28 i need help


#1

var ("myColor");
var mycolor = //pick a color
console.log(mycolor.length)


What am I doing wrong on #27
#2

You should get used to using standard capitalization for JavaScript variables. It should be myColor, and myColor should be assigned (With an equals) to a color of your choice (As a string, like "Purple" or "Red").

Remove this line:

var ("myColor")

#3

i did that and this is what happen wen i did it Oops, try again. Did you create a variable called myColor?


#4

Post your updated code.


#5

var mycolor = //pick a color
console.log(mycolor.length)


#6

Where the comment is (//pick a color), choose a color and put it into a string and add a semicolon to the end.
For example, var mycolor = "blue";


#7

You didn't do what I told you to? Use proper capitalization on myColor, and assign a string of your color.


#8

okay i had just did that and this is what i got. Oops, try again. It looks like 'mycolor' on line 2 was not defined before it was used. This means either you need to define it, 'mycolor' is spelled incorrectly or you need quotes around 'mycolor'.


#9

A little add-on to what @cadecodes is saying. CamelCase is a good habit to have in programming. Instead of having "mycolor", "myvar", or "mypet" you would change it to "myColor", "myVar", and "myPet" while using CamelCase.

In your code, change "mycolor" to follow CamelCase and post your updated code once again please.


#10

okay this is what i got now jaaakee.
var myColor = "red";
console.log(mycolor."length")


#11

You're almost there!

Variables are case-sensitive. You created the variable "myColor", but you're getting the length of "mycolor".

Also, remove the double quotations over "length" because it is not a string, you want to get the length of the myColor string.


#12

Now it what's me to put 'mycolor' is spelled incorrectly or you need quotes around 'mycolor'.


#13

Put "mycolor" in CamelCase like I've explained earlier.


#14

??????CamelCase????????


#15

Change "mycolor" to "myColor"


#16

okay and this what i got
Oops, try again. There was a problem with your syntax.


#17

Show me your code please.


#18

var myColor = "red";
console.log(myColor.'length')


#19

Get rid of the quotes around length.


#20

this is what i got now. var myColor = "red";
console.log(myColor.length)