3 ms·
Block Scope: This is a tricky one, because unfortunately it can't be emulated in a performant way in JavaScript. This is not true. ClojureScript does this and
by swannodette 15y ago
Block Scope: This is a tricky one, because unfortunately it can't be emulated in a performant way in JavaScript.
This is not true. ClojureScript does this and it's plenty efficient. What you lose is mutability of the loop local from inside a closed over function. Given how many people get burned by the JavaScript behavior clearly block scope is expected. I doubt anyone would miss the dubious ability to mutate a loop local via callback. Certainly not as much as I miss control over scope & names in CoffeeScript.