Guest User

Untitled

a guest
Feb 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Scope has to do with the declaration of variables. Specifically, the scope of the variable determines which functions can access it.
  2. There is local scope, that is variables declared in a function, and global scope, variables declared outside of functions.
  3.  
  4. Global variables may cause functions to be indeterminate. Indeterminate functions may have an unintended result. Along with that,
  5. global variables can collide with others declared in other documents.
  6.  
  7. Strict mode requires the declaration of variables with let and const. Without proper declaration an error will be triggered. This
  8. helps with collision/mutation issues with global variables.
  9.  
  10. Side effects of global variable issues would include functions which change a local variable but in fact also change a global.
  11. Another side effect is if two authors write the same variable with different intentions.
  12. A pure function is both determinate (has the same intended result every time) and has no side effects.
Add Comment
Please, Sign In to add comment