3 ms·
The second answer states it best: "They all use closure(even in the 1st example)." If you're accessing a local variable from a different function scope than it
by lhnz 14y ago
The second answer states it best: "They all use closure(even in the 1st example)."
If you're accessing a local variable from a different function scope than it was created in then you are using a closure - there is nothing special about how it was defined, this is the only distinction.