Guest User

Untitled

a guest
Mar 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Scope is how your declared variable can be accessed at a differen point in your code. Scope is categorized into two types: global scope or
  2. local scope. Global scope can be accessed every point in your code. Therefore, global variables are declared outside a function in JavaScript.
  3. Local scope is a variable defined in the function. The local variable is access inside the function. Of the two types of variable, global
  4. variables are best avoided since they have strong tendency for side effects. Side effect is when a function reaches outside of its local scope
  5. and into parent scope and changes the values of the variables that are in these scopes. Pure function is when your code is free of side effects
  6. and is determinate. Beside globa or local scope, there is strict mode. To declare strict mode, 'use strict' is declare at the top
  7. of the code. Also, undeclared variables are not allowed in strict mode since they cause errors.
Add Comment
Please, Sign In to add comment