Skip to content

Instantly share code, notes, and snippets.

@wklug
Created October 25, 2016 15:21
Show Gist options
  • Save wklug/45728960943b00c30ebb0d62a7177d8f to your computer and use it in GitHub Desktop.
Save wklug/45728960943b00c30ebb0d62a7177d8f to your computer and use it in GitHub Desktop.
JavaScript curiosities
/**
* Difference between implicit and explicit global variables
**/
var myGlobal1 = 'P. Nutt';
myGlobal2 = 'Hazel Nutt';
delete myGlobal1; // false
delete myGlobal2; // true
console.log(myGlobal1); // P. Nutt
console.log(myGlobal2); // ReferenceError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment