Skip to content

Instantly share code, notes, and snippets.

@ohanhi
Last active November 5, 2020 09:09
Show Gist options
  • Save ohanhi/f362245659fccea2b671 to your computer and use it in GitHub Desktop.
Save ohanhi/f362245659fccea2b671 to your computer and use it in GitHub Desktop.
console.log
var x = 1;
console.log(x);
if(1) {
var x = 2;
console.log(x);
}
console.log(x);
var x = 10;
function foo(x) {
if(!x) {
x = 4;
}
console.log(x, arguments);
};
foo(7);
console.log(x);
foo.call(7);
var foo = (function() {
console.log(x);
})();
foo(5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment