Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hongttran/3b21a5b670d6adef972a0b0bb1107c6d to your computer and use it in GitHub Desktop.
Save hongttran/3b21a5b670d6adef972a0b0bb1107c6d to your computer and use it in GitHub Desktop.
A scope would be the global and local scope, which is a set of variables, objects and functions in which global scopes can be accessed outside of the function, and local scope can only be accessed from inside of the function.
Global scopes tend to be avoided because since it is not specifically declared, it could override commands of the local scopes leading to a lot of bugs and errors which would require debugging.
Javascript strict mode is when it prevents certain actions and allows more exception. It could allow an error to take place is a variable is not declared.
A side effect is when a global function overrides the local function and unintentionally modifies, while a pure function does not modifity the variables outside of the scope and returns the same results if the same system is being used.
Hosting is the way a JS interpeter finds the variable declaration in a scope, and moves it to the top of that scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment