Why is it printing FALSE


#1

https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/0/2?curriculum_id=506324b3a7dffd00020bf661

The code is printing an additional false after the expected output, I haven’t given any console.log() statement.


**My Code**
var understand = true;

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



#2

It is normal for the console to respond with the flushed contents of its buffer, which in this case is the last assignment made,

understand = false;

Swap the two lines so the assignment is done before the logging out.


#3

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