Lesson 1 topic 6 editor and comments


#1

This is asking me to find the length of cake, so i do, and it shows 4, however it says that i didn't do it right. can anyone help?


#2

post your code so we can help :wink:


#3

Are you finding the length of the string cake, or a variable called cake?
If it was the first one:

"cake".length;

and the second:

var cake = "chocolate";
cake.length;

#4

Same problem as nightrider556. Found the length, but page still shows "error" and won't let me continue. Here are the instructions:

Instructions
The computer will ignore the code on lines 1-2, since it is commented out.

On line 3, find the length of the word "cake".

And here's my code:

  1. // This is a comment that the computer will ignore.
  2. // It is for your eyes only!
  3. "cake" .length

Returns result "4" which is correct, but page also returns:
Oops, try again. Did you find the length of "cake"?. Click "Stuck? Get a hint!" for an example.


#5

Try it without that space separating the string from .length.