Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Scope is the area in which the program executes or is affected by. In terms of global vs local, global is for the whole program throughout it all
  2. Where as local or block scope is only for the function you write in the program.
  3. Global variables are avioded because you want to avoid side effects which is when a value is changed from the local scope to the parent one or indeterminantes where a variable will return a certain value sometimes and another value other times
  4. when one enables strict mode throught the whole program if you dont change the variable with let or const an error will occur
  5. side effects are when a set value in a local scope also changes in the parent scope
  6. to be pure you need to have no side effects and no indeterminants
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement