How do I print the length?


Does anyone know how to do this
How do I print the length?

What is your name? Hi! Let's get to know each other. What is your name?

Here with the instructions

  1. On line 1, create a variable myColor and give it a string value.

var myColor  = "Red"

2.On line 2, print the length of myColor to the console.

console.log(myColor.length )


Thank you. I figured it out. I also do Khan Academy. Can you tell me how do this??

The JavaScript Moles in Holes Challenge


Can you please help?


Yeah create a drawMole function and call upon that function and line up the x and y coordinates with where the holes are.


Hi sorry if I take too for respond you here what they aske you to

1 in the first step you just need to call the function drawMole, like that
In the bottom of the code


2 second step they aske you to put some argument inside the function drawMole. Put inside the function two name the first name molex and the second moleY.

3 they aske you to call the function drawMole().


You aren't going to learn a darn thing if you simply ask others how to do everything. Always Google first, second and third before asking someone or posting on a forum. Best get in the habit early if you plan on sticking around. Although, that's not technically needed for what you asked considering there's a hint feature during exercises.


I tried but my school blocks everything so Google isn't much help.


For example, I'm stuck on this, and this is what I produced


google was made by people, so people can be just as smart


google isnt always the answer, maybe most of the time, but not always, since people made the internet and people are sometimes wrong, google must have some mistakes here and there, so it depends on the person your asking verses googling it.


that's because pink is undefined. its nothing.

"pink" would make it a string of the word pink

"pink".length would mean its equal to 4.
(this statement is true) is also doing nothing either.
Don't forget about console.log.

After else you have to put a default value in. You can't compare anything any more, you would have to use else if again to check again. But you need an else statement to close it with it's default value, that will be used if the code doesn't fit any part of the if loop.

if("pink".length === 4){
console.log("This statement is true");
}else if ("pink".length === 3) {
console.log("This statement is false");
console.log("oops I broke somewhere");


pink like that means nothing "pink" makes it a string "pink".length makes it the value of 4.

You need console.log to make things appear in the console. This is core to showing js in the console, and you should really know to use console.log by now.

else can't check anything only have a default value such as else { console.log("cake")

I suggest maybe re-going over some of the earlier lessons to get the core parts of javascript that you haven't understood properly.

Enjoy, hope this was explained well and helped :slightly_smiling:


Um thank you but it said it didn't recognize the "else" factor. Please help :confused: but thank you for everything else.


Thank you. Would you happen to know the "else" factor?


It's because else needs a default value, you can't make it check/compare anything so it would be

} else {
console.log("oh no I'm broken");


Ok thank you a lot..


What? That doesn't make any sense.


Which part makes no sense?