While Loop print out



Why does the second line with 0 print out?
I thought only that which is in the console.log will print on the screen?
Thanks in advance.

var bool = 1;

    console.log("Less is more!");
    bool = 0;


its console behavior. You update a variable after the last console.log, so this variable is displayed in the console

simply swap the console.log and the updating of bool


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