5. Practice makes perfect bug


#1

So, the exercise was working on, https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/1/1?curriculum_id=506324b3a7dffd00020bf661 , told me to log this string, "I'm looping" to the console. Thus, my code WAS right, but the error message says "Oops, it looks like your logging the wrong string to the console." So heres my code.

var count = 0

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

loop();

Please help?
Thanks,
ThatGoldenSteelix


#2

Try setting count just inside the loop so it resets with every new call. When the SCT calls the function, count is already too high for the loop.


#3

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