Skip to content

Instantly share code, notes, and snippets.

@just-Bri
Created September 17, 2019 11:40
Show Gist options
  • Save just-Bri/43d5adf06e86bbfa4d4401a783dd4834 to your computer and use it in GitHub Desktop.
Save just-Bri/43d5adf06e86bbfa4d4401a783dd4834 to your computer and use it in GitHub Desktop.
Variable Scope
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