Guest User

Untitled

a guest
Mar 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. Scope is a term for specificity of access a variable, function, or object has from different parts of code.
  2. Global scope refers to variables written outside of functions and are easily accessed from almost all scripts and functions on the site; these variables are often referred to as global variables.
  3. Local variables have local scope, and they are usually written within a function only to be accessed within that function.
  4. Calling a global scope too often can lead to unintended "side effects". While “intended” side effects are sometimes beneficial, “unintended” side effects can lead to buggy code. One example would be a function unintentionally calling a variable outside of itself in order to carry out its instructions with unforeseen outcomes. Because these outcomes vary, the functions are called “indeterminate” functions. Strict mode is used to send an error whenever “let” or “const” are not being used in a variable, preventing them from being mutable. A pure function is both “determinate” and has no side effects.
Add Comment
Please, Sign In to add comment