What are variable / anonymous functions and closures? And what are they? How to use?

3

I think most of the question has already been asked in the title.

Being more specific, I wanted real examples of using these techniques and the relationship between them.

Note: I read other related answers, but I could not understand 100%.

    
asked by anonymous 31.12.2014 / 16:09

1 answer

4

Anonymous functions and closures are very distinct elements, but basically anonymous functions are functions that do not have a name (it seems obvious) and this allows a huge ease in the implementation of callbacks

Closures have to do with the scope / scope of a variable, very useful for resolving the sending of parameters to event functions using functions that return a function.

    
01.01.2015 / 01:27