Created
September 17, 2019 11:40
-
-
Save just-Bri/43d5adf06e86bbfa4d4401a783dd4834 to your computer and use it in GitHub Desktop.
Variable 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
What is scope? Your explanation should include the idea of global vs. block scope. | |
The part of a file/program that a certain function is accessible, block being within a function etc. Global being defined outside of a function and available anywhere. | |
Why are global variables avoided? | |
They can cause serious issues with scope and may intefer with code you did not write. | |
Explain JavaScript's strict mode | |
When a variable is declared without the let or const keyword, an error will be triggered. | |
What are side effects, and what is a pure function? | |
A pure function returns something and does not alter any outside code. | |
Side affects are caused when a function alters code outside of itself. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment