Why won't the console log anything? When to While and when to For #8


#1


https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/2/1?curriculum_id=506324b3a7dffd00020bf661#


I get a green check meaning that my syntax is correct and yet, nothing is logged into the console. What am I doing wrong?


var wifi = 0;
var libraryFun = function(){
    while(wifi<5){
        console.log("No connection sucks!")
        wifi++
    };
    console.log("Now we are working!");
}

for (var w = 0; w >= 5; w++) {
    console.log(w +". " + "Is this working?")
}


#2

This won't log unless it is called.

The loop will never run Change to <=.


#3

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