Skip to content

Instantly share code, notes, and snippets.

@orhanveli
Created September 23, 2020 13:48
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 orhanveli/af7fd930639f0e399eb7f53bb2bea96f to your computer and use it in GitHub Desktop.
Save orhanveli/af7fd930639f0e399eb7f53bb2bea96f to your computer and use it in GitHub Desktop.
What will the code below output to the console and why?
(function(){
var a = b = 3;
})();
console.log("a defined? " + (typeof a !== 'undefined'));
console.log("b defined? " + (typeof b !== 'undefined'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment