https://en.wikipedia.org/wiki/Functional_programming == function arguments
函数式参数（“Funarg”） —— 是指值为函数的参数。 http://goddyzhao.tumblr.com/post/11311499651/closures
概念 原理 实现 作用
When to use Closures?
Allows us to hide the implementation details of a context from outside scopes, while exposing a controlled public interface. This is commonly referred to as the module pattern or revealing module pattern.
Closures as arguments
We can also pass closures as arguments to a function, which is a powerful functional paradigm for creating more graceful solutions for complex code. Take for example a minimum sort function. By passing closures as parameters, we could define the implementation for different types of data sorting, while still reusing a single function body as a schematic.
When not to use Closures ?
Although closures are powerful, they should be used sparingly due to some performance concerns:
Large scope lengths
Multiple nested functions are a typical sign that you might run into some performance issues. Remember, every time you need to evaluate a variable, the Scope Chain must be traversed to find the identifier, so it goes without saying that the further down the chain the variable is defined, the longer to lookup time.