While syntax


#1

var understand = true;

while( understand === 0 ){
console.log("I'm learning while loops!");
understand = false;
}

Oops, try again. It looks like you didn't print the string to the console. Check your loop syntax!

What i need put between brackets?


#2

var understand = true; // boolean

while( understand === 0 ){ // 0 is number 
	console.log("I'm learning while loops!");
	understand = false;
}

We dont can compare a boolean with a number


#3

In fact you can just write,

var understand = true;

while( understand){
console.log("I'm learning while loops!");
understand = false;
}

#4

Yes, I already knew, thanks! :slight_smile:


#5

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