[solved] 5. Practice Makes Perfect function() loop()


#1

Hello all,

I managed to complete this exercise, but I'm wondering why the function and loop brackets don't have anything in them.

Thanks,
Amy


var count = 0

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

loop();


#2

What do you mean your function doesn't have anything in the brackets? ( ) has nothing because it takes no parameters (input), and { } is holding your loop. Also, your loop has the condition of the loop in ( ), and the body of the loop in { }. I guess I don't understand your question. Can you elaborate?


#3

Don't worry! I figured it out!
I was confused as to how the () worked. I didn't really understand what an argument was, and that you could just not have one.


#4

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