I believe similar questions have been posted before, but I don't entirely understand why using a callback function as a While loop statement, such as seen below, results in an infinite loop:
do {
console.log("repeat");
} while(myFunc);
function myFunc(){
return false;
}
This version, on the other hand, prints "repeat" once and then stops:
do {
console.log("repeat");
} while(myFunc === false);
Why is that?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…