5. Practice Makes Perfect


This is the session:

This is the code I currently have.

count = 0;

var loop = function(){
while(count > 3){
console.log("I'm looping!");
count++ ;
//Your code goes here!


It's not working and I honestly have no idea what I'm supposed to be doing at this point.


Use a < :wink:

The way you have it, javascript looks at the count variable, sees that it's currently = 0 so it doesnt need to do anything, then ends.

Hope this helps


the condition in the while loop has to be true to run, and the while loop ends if the conditions becomes false, lets look at your loop:

while(count > 3)

in the beginning, count is 0. 0 is smaller then 3. Condition is false, loop won't run. It should be the other way around:

while(count < 3)

now the loop will run until count reaches 3.


Okay. Many thanks!

Apparently it was just a simple typo I overlooked.