While Loop: While Syntax


#1



var understand = true;

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

Simple question: How is //var understand = true// a condition and not just a value assignment. MY understand is that conditions can be tested, but assignments are just bits of data the computer has a name for.
What am I missing here?


#2

All conditions represent a state of either true or false. Regardless the expression, the yield is always boolean. true is therefore a condition.


#3

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