Skip to content

Instantly share code, notes, and snippets.

@Mattteo1220
Created March 13, 2017 01:15
Show Gist options
  • Save Mattteo1220/94d6c905568b399735c263772d7aa31a to your computer and use it in GitHub Desktop.
Save Mattteo1220/94d6c905568b399735c263772d7aa31a to your computer and use it in GitHub Desktop.
Scope has two parts, global and local. Scope has to do with Variables and using these variables within your code and more specifically functions. Global variables can be used all around in your code. Local variables are specific to their parent functions.
Global variables are avoided because they can be called within functions and potentially changed or altered created hard to find bugs.
Strict mode in JS helps the user write strict code. for example, foo = "foo fee foo foam"; is not strict. It is missing the Var keyword. This needs to be added in. STrict enforces the Var keyword use on all variables.
Side affects are bugs or errors produced from global variables called within functions and it alters their true meaning. also, affects can be caused by not using strict mode.
Variable hoisting I can't define right now. I'll get back to you on that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment