27.Conclusion:Part 1


#1


https://www.codecademy.com/en/courses/getting-started-v2/4/4?curriculum_id=506324b3a7dffd00020bf661


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


console.log(myColor.length);
"myColor".length

It says that line one is undefined. I don't understand how.


#2

have you created the var myColor?


#3

You haven't declared/created the variable myColor

step 1 - create the variable myColor and give it any string value (even your name is ok)

step 2 - console.log the variable's length

var exampleVariable = 'thisIsMyName';
console.log(exampleVariable.length);

#4

Thanks guys you were really helpful!


#5

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