5. Practice Makes Perfect: Why var loop = function()



More of a question.. Why do we need var loop = function() in the following code:

Not understanding why that is relevant. Is there a way to write the code without that line of code?

Any insight is appreciated. Thanks!

var count = 0;

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


Yes, your code would still work without that line. writing the code with this line var loop = function() makes the code reusable. Meaning it can be called multiple times. :slight_smile: