Skip to content

Instantly share code, notes, and snippets.

@yaroslavya
Created February 26, 2013 10:24
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 yaroslavya/5037499 to your computer and use it in GitHub Desktop.
Save yaroslavya/5037499 to your computer and use it in GitHub Desktop.
Reassigning undefined inside a function.
function changeUndefinedInside(undefined){
undefined=42;
var a=42;
console.log(undefined);//42
console.log(a===undefined);//true
};
changeUndefinedInside(undefined);
console.log(undefined);//undefined
undefined=42;//trying to reassign undefined in global
console.log(undefined);//still undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment