-
-
Save eiriklv/15fdc4693da744f3c4ae to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//global variable | |
test = 'hello'; | |
//is exactly the same as | |
global.test = 'hello'; | |
//local variable - this will definitly override your global variable | |
var test = 'world'; | |
//using the process scope, if, and really if, you can't do without a global variable | |
process.test = 'world'; | |
//Now both will be defined and using `process` will avoid any confusion | |
console.log(test + process.test); | |
//hello world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment