Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. Scope is a set of rules wwithin a program where one can access variables in functions that have been declared. There are 2 types of scopes: local and global. Local scope is nested inside a block fuction and. global scope can be accessed from any and all functions. In javascript most functions sstart out as global scope.
  2. Global scopes are mostly avoided because they make the errors harder to locate therefore making the code buggy.
  3. Javascript strict mode is used to help detect/prevent errors by letting one know right away that there is an error. The strict mode helps prevents errors that normally would not show up in the global scope space with a variable. you can use the strict mode either on the entire code or just a certain function. Strict mode makes it easy to write in secure mode.
  4. Side effects in JavaScript is when a function goes outside of that function into the outer folds of the function until it alters a local scope. when side effects alters a global scope it can leave a fuction indeterminate. A pure fuctions is when the function is both determinta and has no side effects.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement