Created
July 6, 2017 14:09
-
-
Save bmorelli25/2b83383befabdee4fa37a394ca9ee24d to your computer and use it in GitHub Desktop.
global
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
| // Example of accessing variables OUTSIDE the function | |
| // words is a GLOBAL variable | |
| var words = 'hi'; | |
| function speak(){ | |
| console.log(words); | |
| } | |
| speak(); // 'hi' | |
| console.log(words); // 'hi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment