a guest Oct 20th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- 1) Scope is a set of rules that defines what part of your code can access a particular variable. Variables with a global scope are declared outside of functions and can be accessed anywhere in your code. Variables with a block scope are declared inside functions and can only be accessed within that function and they also cease to exist after the function stops executing).
- 2) Global variables are avoided because they lead to unintended side effects which leads to functions becoming indeterminate.
- 4) A side effect is when a function alters a value outside of its local scope. A pure function is one that is determinate and has no side effects.
RAW Paste Data