Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. Scope helps detemrine where funstions and variables can be accessed in a code. It helps avoids bugs. Global scope extends across files. One of the great things about Global Scope is that if you refer to the Global Variable in one file you can refer to it somewhere else in the file. Global scope differs from Block Scope. Block Scope means that a variable is only accessible within the function(s) block of the line's instructions.
  2. Global Variables are avoided because when using multiple global variables it is easy to overwrite values of another variable. A variable declared outside of a function becomes global. Again, this can be accessed by all functions.
  3. Java's 'strict' command enforced a strict mode for the entire file. This command is put at the top of the file to ensure thatcertain actions are being taken. This is also an indication to the developer that the code should be executed in 'strict' mode only!
  4. Side effects are when a function reaches outside its local scope (variables declared inside of a block) into a parent scope and it changes a value that resides there. A pure function is when it is bother the determinate and it has no side effects. This means that a function that is considered a Pure function(s) accepts an input and returns a value without modifying any datta outside of its scope.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement