Why does this while loop print "1" at the end?..I only want it to print console.log statement. Saw when using Codecademy.
for (i = 0; i < 2; i++) {
console.log("I understand for loops twice..lol");
};
var whileUnderstand = 0;
while(whileUnderstand < 2) {
console.log("I understand while loops twice..lol");
whileUnderstand++;
}
That question doesn't have the direct answers to the question that i asked. Furthermore, it only includes console.log statements instead of loops. Mainly, there are no answers saying that "The console is simply outputting the last evaluated value of the statement." which is the answer that solved my question.