5/11 While Loops


#1

Hey, I'm currently stuck on this exercise. I cannot seem to get my code to work. Please help me on this code. Can someone explain why it is wrong and how I can correct and understand so that when I run into this in the future I have an idea of what to do.


#2

Why do you use while on line 10? I would log count to the console, not while


#3

So first off you'll need to reset your code.
I had trouble with this one too, but after reading through the forum, I found that I had made
the exercise overly complicated on my own. All you need is the code that follows; the function only serves the
purpose of calling the function afterward, it's not needed for the loop.

var count = 0

var loop = function() {
    while(count < 3) {
        console.log("I'm looping!");
        count++;
    }
}

loop()