SyntaxError: Unexpected token {


#1

I am going cross eyed trying to find my error if someone could take a look I'd appreciate it

var nose = 1
var loops = fuction(){
    do {
        console.log("Do Loop... CHECK");
    }
    while (nose) {
        console.log("While Loop ... CHECK");
        nose=0;
    }
    for (nose === 0;  nose<1 ; nose++) {
        console.log("For Loop.... CHECK");
    }
};

loops();

#2

Everything in the brackets after the "while" needs to be deleted.

Do while loops only run the code between the "do" and "while".

while (nose) 
{                                            //<------------------Delete these!
        console.log("While Loop ... CHECK"); //<------------------Delete these!
        nose=0;                              //<------------------Delete these!
    }                                        //<------------------Delete these!

Remember it's:

do { ... } while( /*parameter*/ )

while ( /*parameter*/ ) { ... }

for (nose = 0 ; nose < 1 ; nose++) { ... }
          ^
//only 1 equals " = " sign

#3

Hi @ashleykay89,

beyond what @lolman has put, and keeping in mind this will result in an infinite loop your actual error is probably much simpler :smile:
fuction vs function
:smile:


#4

hahahahahahaha... I think I need a nap


#5

As a side note keep these things in mind.

while (nose)

This while statement is evaluating while "nose" == true.

So this while loop is an infinite loop and will crash the browser.