3 ms·
functions scope sucks though :( Writing callbacks inside a loop can be a pain.
by ufo 14y ago
functions scope sucks though :( Writing callbacks inside a loop can be a pain.
- quarterto 14y agoES6 will have proper block scoping using let. You can use that today in JavaScript 1.8 compliant engines (so far, just SpiderMonkey).
- masklinn 14y agoThat's not really an issue of function scope. It's an issue of closing over mutable bindings, though loops + function scope do make it more likely for the issue to arise. And ES6 adds block scopes (via `let`, inherited from Mozilla's javascript extensions). That strays from the original complaint though.