#27 conclusions 1


#1

stuck on 27 conclusions 1

how do you give a variable string value? and when entering code for the my color variable it says the color I choose is undefined how do I define the color of my variable?


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


Replace this line with your code.


#2

how do you give a variable string value?`

var x = "grantham95"; // as your name is a string value

and when entering code for the my color variable it says the color I choose is undefined how do I define the color of my variable?
It's asking for string value...
If you have given something like

var my_color = undefined;

then I'd throw an error as it asked for string value!!
String value always goes inside quotes (single/ double)!
I'd do something like this..

var my_color = "red";

then i print is using console.log()


#3

it is saying my color isn't set to a string value. On line 2 it says to log the length of the my color variable. so inside of console.log would the code be myColor.length = 3 if I choose the color red?


#4

myColor.length = 3
It will create an error!

Revision Section ---

suppose there is a string...

var name = "Erick";

If I had to find the length and print it
I'd write like this...

console.log(name.length);

I hope it helps. :slight_smile:

Though I strongly suggest you to revise the whole section again!!!


#5

okay I appreciate your help but for some reason after following everything you've said its still saying that the mycolor isn't set to a string value and my code looks fine ill post the link below

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


#6

Post the code.

Link does give the page but it does not send me to your code but my page! :slight_smile:


#7

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


#8

my_Color?
As instruction says--

So It's myColor


#9

var my_Color = "my_Color";
console.log("my_Color".length);

this is the new code and now its saying that I didn't print mycolor to the console even though it is showing up in the box that shows your code after you run it? I'm really sorry for all the trouble


#10

never mind just got it thanks for the help!!


#11

I am having trouble getting past this also. How did you do it? please help....


#12

What error you're getting ?


#13

Thanks so much for responding so quickly. I just got past it. I got it wrong so many times and then it finally accepted my answer


#14

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