Questions:
What is scope? Your explanation should include the idea of global vs. block scope.
Why are global variables avoided?
Explain JavaScript's strict mode
What are side effects, and what is a pure function?
- Scope determines the visibility/accessibility of variables, objects, and funcitons within the code.
JavaScript has global scope, function scope, and with the addition of ES6, block scope using let and const. Global
variables are available everywhere but are typically viewed as bad practice because they can produce unintended
results down the line. They also can be a performance hit, because when JavaScript is compiled it checks for variable