Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What is scope?
- Scope refers to the useability of variables, which parts of your code can change or use it.
- You have two types of variables, global & block:
- Block variable is created inside of a function and can only be used and altered inside of the function it was created in.
- Global variable is created outside of a function and can be used and altered anywhere including any functions.
- Why are global variables avoided?
- Because every function has access to global variables, it's hard to figure out which functions use and alter these variables.
- Explain JavaScript's strict mode
- Using strict mode enforces good programming practices by giving you an error when you haven't declared a variable with either let or const.
- What are side effects, and what is a pure function?
- 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