Skip to content

Instantly share code, notes, and snippets.

@sairion
Created August 30, 2016 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sairion/413e51f9266e4ffa96fec04f7d68d0a8 to your computer and use it in GitHub Desktop.
Save sairion/413e51f9266e4ffa96fec04f7d68d0a8 to your computer and use it in GitHub Desktop.
non-hoisting-behavior-of-let.js
// ES5 lte
try {
var a = {
c:1, b: (function b() { return this.c }).bind(a)
};
} catch(e) { console.warn(e); }
// ES2015
try {
let a = {
c:1, b: (function b() { return this.c }).bind(a)
};
} catch(e) { console.warn(e); /* ReferenceError: a is not defined */}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment