While Loop declaring var


#1

Why didn't i have to declare a "var understand" in this exercise?

understand = true;

while(understand){
	console.log("I'm learning while loops!");
	//Change the value of 'understand' here!
	understand = false;
}


#2

why would we? variable can be declared without the var keyword.


#3

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