3 ms·
I honestly didn't recognize his description of closures. It sounded like memoization. Closures are probably best understood without metaphors like that, scoping
by mattnewton 10y ago
I honestly didn't recognize his description of closures. It sounded like memoization. Closures are probably best understood without metaphors like that, scoping in JavaScript might be weird but it is consistent everywhere- only functions have scope, and they carry that scope for their entire life. I think just thinking of everything in the language as a collection of scopes really clicked it for me.
The real trip up with javascript I often see even in professionals is asynchronicitiy, since JavaScript has a run loop.