Everything works just fine- I just have a question-


#1



why did the console log only showed "im looping" only after i added the loop(0) in the last line?

var count = 0

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

loop(0);


#2

Because when creating a function, you aren't telling it what predefined variables to use, but rather what inputs to get when being called on. If you had done loop(count); at the bottom, it would've worked.


#3

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