Everything here is written to yourself!
1. Understanding of closures.
Closures are a means by which local variables within a function can be manipulated outside the function.
2. Cases.
Gets and sets the local variables inside the function functions. (normal condition gets less than n)
Click the number of the Li output li.
Every call is different.
3. Precautions for using closures.
1). Closures can cause variables inside the function to be stored in memory and have a large memory consumption, so closures cannot be abused, which can cause Web page performance problems. Memory leaks may be caused in IE. try to remove unused local variables before exiting the function.
2). Closures can change the values inside the function outside of the function, and when the parent function is used as an object, the closure is used as a public method and the local variable as a private property, the value of the local variable is not easily changed.
JavaScript---Closures