Closure, if the internal variables of the parent function are not called, will the internal variables of the parent function be recycled?

clipboard.png

closure, which leads to memory leakage due to the fact that the internal variables of the parent function cannot be reclaimed by the recycling mechanism;
problem,




Mar.04,2021

you should know about the garbage collection mechanism of Javascript .


a will be recycled if there are no referenced variables, but b will not. Please refer to http://www.cnblogs.com/antine.

Menu