Syntax error


The console says that I have an unexpected token ) but I can't find the problem

var snow = true
while(snow = true) {
    console.log("It is snowing!");
    snow = false;
var cold = 0
for(cold = 0; cold < 5; cold++) {
    console.log("It is cold out!");


a single equal sign means assign, it doesn't check if two values are equal


Okay, I changed it to while(snow) and it worked! Thanks!


that is also valid, you understand why? For checking if things are equal, you could use 2 or 3 equal signs


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