Code for Do / While Loop Results in Nothing Printed to the Log?


#1

Nothing is printing in the log as a result of this code for a do / while loop, yet Codecademy is saying this code represents correct coding for a do/while loop. Why is nothing printing?

var hungry = true;
var dinner = function(hungry) {
do {
console.log("Let's eat!");
} while(hungry === false);
}


#2

a function only executes when called. There is no function call, thus the function is never executed, thus a console.log is never reached, nothing is logged to the console


#3

Makes sense. Thanks!


#4