Guest User

Untitled

a guest
Feb 13th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. Scope is what determines the visibility/usability of variables within your program. Global variables are ones that can be used anywhere inside of your program (outside of functions) while local variables are ones that are created inside of functions.
  2. The issue with global variables is that you can increase the chances that you accidentally overwrite the value of a variable with a variable with the same name (unintended side effects). They can create problems in your code that are difficult to find and fix and furthermore, can create indeterminate functions that cause further issues with your program.
  3. Strict mode is a way to prevent errors in your code. One important feature is that it doesn't allow you to declare variables without using let or const. This allows you to prevent unwanted global variables and also makes sure that your code follows the best guidelines in order to run properly. It changes what used to be bad syntax and creates errors which you can easily read to fix your code.
  4. Side effects are when a function that is nested, alters the value of something in it's parent scope. Pure functions are ones that don't have side effects and will give you the same output as long as the same input is given.
Add Comment
Please, Sign In to add comment