Conclusion Pt 1, String Value?


#1

In Conclusion Pt 1 of Get Started with Programming, It asks me to do the following,

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

I have no idea what a string value is and how to apply it with the variable.
Now, i'm just stuck and confused..
Any help would be great


#2

String type represents text. We create variables of this type by enclosing text in quotation marks.

Example:

var a = 8;                                    // a is a number
var b = "8";                                  // b is a string
var c = "Example of longer string value";
var myName = 'Maciej Wiercioch';              // you can also use single quotes

#3

A string value is quoted text:

var aString = "This is a string value";

otherwise known in JavaScript as a string primitive.

Strings have a length property which we can query like so,

aString.length

To log this value, we would write,

console.log(aString.length); // 22