Skip to content

Instantly share code, notes, and snippets.

@softwarespot
Last active September 30, 2015 06:21
Show Gist options
  • Save softwarespot/9976086060b1cfed4ae4 to your computer and use it in GitHub Desktop.
Save softwarespot/9976086060b1cfed4ae4 to your computer and use it in GitHub Desktop.
Funny JS oddity
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