11.) When All Three Types of Loops Are Correct


So when all three loops are correctly written out in code on lesson 11 of Introduction to "While" loops nothing will show up in the console log? Or should all three show up in the console log? Love to hear an explanation of it if possible. Code is below:

var brad = function () {
var smart;
do {
smart = false;
console.log('Brad is smart');
} while (smart);

smart = true
while (smart) {
    smart = false;

for (var i = 0; i < 1; i++) {



You've nested your loops in a function and that function is not called therefore nothing is executed.


Ah thank you! Just curious. I did not know if that was supposed to happen or it was my error. So I will go correct my error for the sake of curiosity :smiley:


When you use console.log you should see something on the console. So it is a logic error, kind of like a sentence in proper English that just doesn't make sense.


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