Re:From jQuery to JavaScript and back again
by ufo on Friday February 08, 2013 @09:24AM
(#5187968)
functions scope sucks though :( Writing callbacks inside a loop can be a pain.
[ Parent
| on HN ]
Re:From jQuery to JavaScript and back again
by quarterto on Friday February 08, 2013 @10:21AM
(#5188235)
ES6 will have proper block scoping using let. You can use that today in JavaScript 1.8 compliant engines (so far, just SpiderMonkey).
Re:From jQuery to JavaScript and back again
by masklinn on Friday February 08, 2013 @10:24AM
(#5188252)
That'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.