Last active
September 30, 2015 06:21
-
-
Save softwarespot/9976086060b1cfed4ae4 to your computer and use it in GitHub Desktop.
Funny JS oddity
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
var undefined = 'Undefined is now a string'; | |
// Immediately-Invoked Function Expression (IIFE) | |
(function (undefined) { | |
console.log('Local undefined is: ' + (typeof undefined)); | |
})(); // Don't pass anything, so undefined locally will be truly undefined | |
console.log('Global undefined: ' + (typeof undefined)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment