Skip to content

Instantly share code, notes, and snippets.

@AkatQuas
Last active December 10, 2019 08:39
Show Gist options
  • Save AkatQuas/abe688c40409a5d89e12d2b26e5b2b75 to your computer and use it in GitHub Desktop.
Save AkatQuas/abe688c40409a5d89e12d2b26e5b2b75 to your computer and use it in GitHub Desktop.
what is the value of `a` ?
debugger;
var a;
if (true) {
a = {a: 2};
function a() {}
a.ot = '9';
a = {a: 4};
console.log('1', a);
}
console.log('2', a);
// relevent question on stackoverflow
// https://stackoverflow.com/questions/58619924/confused-about-function-declaration-in
// https://stackoverflow.com/questions/31419897/what-are-the-precise-semantics-of-block-level-functions-in-es6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment