jeudi 25 juin 2015

How do you nest if statement in do-while loop in javascript

var temp = 110;
for {
    temp-=1
    if (temp >= 90) {
        console.log("Today's temperature is "+temp+"! "+"Lets go play ball")
    } else {
        console.log("Today's temperature is "+temp+"! "+"It is too hot today to ball!")
    }
    
}while (temp > 90)

Please review my snippet. It won't run for some reason stating some bracket error as I already checked the brackets.

Aucun commentaire:

Enregistrer un commentaire