Guest User

Untitled

a guest
Apr 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. What is scope? Your explanation should include the idea of global vs. local scope.
  2. A scope is ability for a variable to be used in certain fuctions. A global scope is a variable that
  3. will be used in every function that calls it. a local scope for a vaiable will only have its value
  4. used in the function that its defined in.
  5. Why are global variables avoided?
  6. With a global variable, every funtion that calls the same global variable name can get the same value from it
  7. which can lead to several functions returning unepected values.
  8. Explain JavaScript's strict mode.
  9. its a statment that puts javascript into a mode that throws errors when you do certain actions, such as accessing
  10. certain global variables
  11. What are side effects, and what is a pure function?
  12. A side effect is when a function reaches outside its local scope up into a parent scope and alters a value that lives there.
  13. pure function gives a consistant predictable value, and has no side effects
Add Comment
Please, Sign In to add comment