"Review"- Where's my error?



The error message I'm getting says "return not in function".

I don't see anything wrong with this that I have.

There aren't any corrective marks on the left side of the editing space.

I've compared this with what's in the hint section.

I've added and taken away brackets, semicolons, etc.

Where is/are my error(s)?

var chemsmireCat= fucntion();{
    var eightball= true;
     while (eightball){
         console.log ("Lets have a Tea Party!");}

var crocodile= "scaley";
for (var i=0; i<crocodile.length; i++){
return (i);}

var kitty=7;
do{ return (kitty++);}while (kitty<12);


There are so many errors in the above one could miss some just trying to point them out. Best advice, save your work in Notepad or some other text editor, then start over from the beginning. Be sure to read the lesson text thoroughly, and review any concepts covered up to this point. Just looking at the code we have no idea what it is expected to do.

Be sure to check your spelling as you write each line.

Whenever we combine a parameter list with a code block, we never separate them with a semi-colon.

() {}
No semi-colon here, ever.


Really? Well!

I've run similar code before. I guess the editor corrects syntax to a point. It doesn't tell you whether or not the code will actually work the way it was intended.

I think the program told me to add that semicolon there because I had misspelled the word "function".

Time to rehash!


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