While loop logging the value of the condition. 8/11


#1

for (var i = 0; i < 8; i++) {
console.log("for loop");
}

var number = 4
var myName = "Deniz"
while (number < 9) {
console.log(myName);
number++;
}

This code logs "for loop" 8 times and "Deniz" 5 times as it should but in the end it logs '8' too. Why would it log '8' to the console?


#2

@jcstuntmaster,
It is a verbose of the Javascript interpreter of the last-action

Add a
console.log(" ");
and you will not see this output.....