addyosmani / es6-equivalents-in-es5

WIP - ES6 Equivalents In ES5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Block Scoping Functions example context

pvdz opened this issue · comments

It'd technically be more like (function(){ ... }.call(this)). And some care of course taken in the arguments department, but that's not so trivial to change without touching the actual code as well.

You could also use the hack that transpilers like Babel use:

try {throw true} catch {
  // lexically-scoped block
}