3 ms·
Like a few people in this thread, I didn't really buy the closure analogies. I think if that were my first exposure to it, I'd end up with some pretty wrong ide
by icambron 10y ago
Like a few people in this thread, I didn't really buy the closure analogies. I think if that were my first exposure to it, I'd end up with some pretty wrong ideas about how they work. Specifically, it's not a snapshot.
I was bothered enough that I went and quickly wrote an explanation of closures in five steps. The language probably needs tightened up a bunch, but I'm curious if it's useful?
https://jsfiddle.net/hghgp6x2/ https://jsfiddle.net/hghgp6x2/