The first ) is an unexpected token and i don't know why


I can't seem to find what's wrong with the code, it thinks the ) at the end of the condition for the while loop is incorrect. I have redone the code 2 times and it still doesn't work. If you look in the hint box, it even shows that i need to write my code that way.

SyntaxError: Unexpected token )

var chicken = true;

    chicken = false

for(i = 5, i < 7, i++){


This should check when chicken = false


(chicken == false)

^The above two missing semi colons


It didn't work, it's still not going through due to the ) at the beginning. I've been stuck on this for hours and nothing seems to make it work.


Refresh your page and do as I said above I'm sure it will work


I did refresh the page, it still doesn't work. It doesn't matter what I change to the while loop. I've experimented with it for a little bit longer and apparently the for loop is causing the problem with the while loop.

When i remove the for loop, the while loop has no issue with the ) and { at the end of the condition. I don't know how or why the for loop is causing the while loop to not work.

EDIT: I put the for loop in front of the while loop and now the for loop's ) and { won't work. If i put 2 for loops in there, the first one won't work still. But with 2 while loops, everything works fine and both of them will log onto the console. With 1 for loop, it won't work. Basically the for loop is the problem.



Have a close look at

for(i = 5, i < 7, i++){

Have a read


Thank you, that worked.