27. Conclusion Part 1


#1

Help! I am typing this....

var myColor = "green";
console.log=(myColor.length);

And the computer responds with "Oops, try again. It looks like you didn't print the length myColor to the console!"
(Also the number five is printing onto the console... which I thought was supposed to be correct!!)


#2

Take out that equal sign you got there... in your console.log.


#3

Here's the code:

myColor = "blue"
console.log(myColor.length)


#4

It does not work either way.


#5

var myColor = "____";
console.log(myColor.length);

Try this structure, replace the blank with a color you like.


#6

@rubyblaster69703,
In such a case you will have to do a Reset....

++++ reset of session *****************
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).


#7

I just got it!

var myColor = "yellow";
"yellow".length
console.log(myColor.length)


#8

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


#9

this works

hope it helps

var myColor ="pale Yellow";
console.log(myColor)
console.log(myColor.length)

:

:smiley:


#10

hey guys please tell me why my color doesn't have parentheses im confused a little


#11

Because it's a variable and not a sting.

if myColor was in " " it would just be "myColor" as text.

var myColor = "blue" stores the string blue in myColor so when you call myColor later on it will display "blue" :slightly_smiling:


#12

thank you so much..lol F5 like a bomb


#13

var myColor="blue";
console.log ("blue".length);


#14

@designcoder78589,

As the variable myColor has an associated string Value "blue"
you could also have used....

console.log(myColor.length);

#15

thank u it worked
var myColor ="pale Yellow";
console.log(myColor)
console.log(myColor.length)


#16