Why the variable dogLove = false is shown on the console, if we don t have console.log?


#1

var loveAnimal = [];
var dogLove = true ;

while (dogLove) {
loveAnimal.push(‘dog’);
console.log(loveAnimal);
dogLove = false;
}


#2

It is the nature of the command line interpreter to flush the buffer of the last declared value when the program terminates. If you do not want to see it, make that statement before the console.log() statement.


#3

Thank you very much!


#4

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