-
-
Save navanathjadhav/62cfd62d709068de01cce7cdd7acca9c to your computer and use it in GitHub Desktop.
Example of Global variables
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
/* | |
* This will be hoisted as a global variable | |
*/ | |
function Greet() { | |
message = "Hello & Welcome to Ever Blogs"; | |
} | |
/* | |
* This will also become a global variable as global functions have | |
* global `this` as the contextual `this` in non strict mode | |
*/ | |
function Greet() { | |
this.message = "Hello & Welcome to Ever Blogs"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment