5. Practice Makes Perfect


#1

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

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!
}
};

loop();

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


#2

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


#3

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.


#4

Okay. Many thanks!

Apparently it was just a simple typo I overlooked.