Created
October 25, 2016 15:21
-
-
Save wklug/45728960943b00c30ebb0d62a7177d8f to your computer and use it in GitHub Desktop.
JavaScript curiosities
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
/** | |
* 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