Advertisement
Guest User

Untitled

a guest
May 26th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. What is scope?
  2. Scope refers to the useability of variables, which parts of your code can change or use it.
  3. You have two types of variables, global & block:
  4. Block variable is created inside of a function and can only be used and altered inside of the function it was created in.
  5. Global variable is created outside of a function and can be used and altered anywhere including any functions.
  6.  
  7. Why are global variables avoided?
  8. Because every function has access to global variables, it's hard to figure out which functions use and alter these variables.
  9.  
  10. Explain JavaScript's strict mode
  11. Using strict mode enforces good programming practices by giving you an error when you haven't declared a variable with either let or const.
  12.  
  13. What are side effects, and what is a pure function?
  14. Pure function is were you provide the same value to the function and it always return the same result.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement