Skip to content

Instantly share code, notes, and snippets.

@just-Bri
Created August 17, 2019 21:45
Show Gist options
  • Save just-Bri/645d287ac2538096a96b9f3646e2f843 to your computer and use it in GitHub Desktop.
Save just-Bri/645d287ac2538096a96b9f3646e2f843 to your computer and use it in GitHub Desktop.
What is scope? Your explanation should include the idea of global vs. block scope.
Scope is the part of a program that something is in. Global means it's accessible from anywhere, block means it lives within that area of the code.
Why are global variables avoided?
AFAIK they are generally frowned upon just because they're global. They can cause naming issues or referencing issues.
Explain JavaScript's strict mode
when you issue 'use strict' at the top of your .js file it will throw an error any time you initialize a variable without a let/const before it.
What are side effects, and what is a pure function?
side effects are when you alter something outside your current scope.
a pure function will always the return the same output given the same input and causes no side effects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment