Practice Makes Perfect


#1



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


Okay so this is more of just a question about syntax. Why do we have to put the "loop();" at the end of line 10? Might be a noob of a question but we didn't have to do it with any of the previous loops.


//Remember to set your condition outside the loop!
1-var count = 0
2-
3-var loop = function(){
4-	while(count < 3){
5-		console.log("I'm looping!")
6-		count++
7-	}
8-};
9-
10-loop();


#2

loop(); on line calls the function you created on line3, i guess in earlier exercises the loop was not inside a function?


#3

Yes that would explain it. Thank you.