Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Scope, simply put, determines the accessibility of variables. The two types of scope described in the reading are global and block. Block scope is used within a function and only can be accessed within that function. Global scope can be accessed from all scripts.
  2. The use of global variables is avoided to prevent unintended side effects within a program. Declaring variables on a global level can lead to tricky and hard to track down bugs.
  3. Strict mode is a tool within JavaScript that keeps the coder from making mistakes in relation to creating variables. Unless the coder uses a 'let' or 'const' statement to declare a variable the console will return an error.
  4. A pure function is one that is both determinate and has no side effects. Side effects can occur when global variables are set and interact with other functions unintentionally.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement