Created
January 12, 2019 17:19
-
-
Save 1kohei1/eb2dff349d333942cd806e191fe1d83f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo() { | |
var undefined = 2; | |
console.log(undefined); // 2 | |
} | |
foo(); | |
// In strict mode, this is also valid | |
function foo() { | |
'use strict'; | |
var undefined = 2; | |
console.log(undefined); // 2 | |
} | |
foo(); | |
// However, you cannot overwrite the global undefined | |
// At least in Google Chrome Console | |
var undefined = 2; | |
console.log(undefined); // undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment