— There is a udemy course I purchased guys clear all the doubts very well
— Wrong reply :P
— Please give me the link.
— Does this make sense to anyone? Please, explain Because print is not supposed to see increase, set and decrease. If number is changed in set, shouldn't it be seen only by set? Besides, what is for loop doing there?. How is print able to see for loop? The topic is closure
— It makes total sense. A function saves its context. In this case, number is available only by these functions. When you use manager it modifies global variables that store the functions. All of the four functions share the same context. For loop is calling increase each loop, having no curly braces is the same as having a single line block of code.