Why while loops print out false condition?


#1


Hi everyone,

Currently l am learning while loops. No error alert for the coding below, but system printed out like this:

I'm learning while loops!
false

Anyone knows why system printed out "false"? Do I need adjust my coding?

Thank you.


var understand = true;

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


#2

it is the codecademy console, echoing the value of the last variable, useful when known and use correctly, otherwise it could cause a bit confusion, but it is nothing to worry about


#3

Got it! Thank you so much.