27.conclusion javascript


in this task that i have it keeps saying my syntax is messed up or something.Does anyone know whats wrong with this

var mycolor(“red”.length);


Are you sure you are supposed to write red as a string?


yes thats the color that i chose because its say my color. right?


Try taking out the quotation marks.


that didnt work it says on line one that red is not defined


Wait lemme see what the level is about…


ok thanks its like a review type thing


Ah, gotcha. Okay, what you are supposed to do is to first define myColor (note the capitalization):

var myColor = "Red" //in your case

Now, there is no length of red. So, instead of “red”, you have to put:


Hope it helped! :smiley:


ohhhhhh ok thank you are the best


The first line is where the issues arise:

var myColor = "red";

This statement declares a variable, myColor and defines it with a string primitive assignment operation.

= is the assignment operator by which we set the values referenced by their variable.

We can log the properties of the referenced object, in this case a ‘string’ type object, "red"


It is worth noting that once we declare a variable, we can assign values or objects to that variable as the program requires with never declaring it again, just re-defining it…

myColor = "blue";
console.log(myColor.length); // 4
myColor = "purple";
console.log(myColor.length); // 6


Hi Friends
I don´t know what am i doing wrong, but still not ok for the system

var myColor= “red”;

The message that system gives me is : Oops, try again. It looks like you didn’t print the length myColor to the console!


log(( is a function, so call it like a function with your output as the argument…



Thanks Mtf.
What stupid i was to write down = !! :slight_smile: didn´t realize!!
Thanks a lot!


I’ve never met a stupid programmer, but I have met many who are occasionally blind to the obvious. That’s human. Be easy on yourself. :slight_smile:


Thanks for your understanding mtf (sometimes, when you realize your mistake, you feel like a stupid. It was just my first reaction facing my mistake. That´s all :smile:
Best regards from Buenos Aires, Argentina. I´ll continue with the course. Thanks!


i need help on the conclusion part 1
i put: var myColor = “turquoise”;
but it says Oops, try again. It looks like you didn’t print the length myColor to the console!

i dont understand
please and thank you


nvm i figured it out
it was the quotes


Remove the quotes around `“myColor”,


We never write variables in quotes. Quotes are for string primitives, only.

split this topic #20

A post was split to a new topic: Your code doesn’t look quite right


Yes because if you don’t input red as a string then what happens is the computer won’t run the code.