Created
June 26, 2018 17:52
-
-
Save BridgeNB/ed13a4f2a4b931906e2944aeb8389fe1 to your computer and use it in GitHub Desktop.
Answer for scope
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
1. Scope is the range where variables are defined and validated. Global scope is the environment | |
where variables are available everywhere in this project. | |
Local scope is a particular area where variables are vaildated, for example, a function or a file. | |
2. We have to avoid global variables to aviod misrable bugs. | |
3. In strict mode, you cannot use a variable without defined it first. | |
4. Side effects is that one function's output will affect other functions. | |
Pure funtion is that this function is both determinate and has no side affect. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment