This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"browser": true, | |
"commonjs": true, | |
"es6": true | |
}, | |
"extends": "eslint:recommended", | |
"parserOptions": { | |
"ecmaFeatures": { | |
"experimentalObjectRestSpread": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://jsbin.com/cubuhap/1/edit?js,output | |
https://jsbin.com/cubuhap/1/edit?js,output | |
https://jsbin.com/dunutu/2/edit?js,output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://jsbin.com/laweco/edit?js,console | |
https://jsbin.com/zihuji/edit?js,console | |
https://jsbin.com/jugahoy/edit?html,js,console | |
https://jsbin.com/cejemuv/edit?js,console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is scope? | |
> Scope, or Variable Scope, is the idea regarding in which part of a program a given variable can be referenced or changed. | |
In Javascript there are two scopes, Global and Local. Local scope is within a function so any variable that is declared | |
(var varOne;) within a funtion can only be referenced or changed from inside that function - that variable's scope is local | |
to that function. Global scope is throughout a program, outside of functions as well as within any functions. A variable | |
that is declared outside of any functions has global scope and can be referenced or changed in any part of the program. Also, | |
when a variable is assigned a value without being specifically declared (varOne = 'value';) from inside a function, that variable | |
has global scope as well. | |
Why are global variables avoided? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://jsbin.com/regeya/edit?js,console | |
https://jsbin.com/hefucod/edit?js,console | |
https://jsbin.com/ketofe/edit?js,console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://jsbin.com/worimex/edit?js,console | |
https://jsbin.com/zeleya/edit?js,console | |
https://jsbin.com/tumomu/edit?js,console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://jsbin.com/hejebub/edit?js,console,output | |
https://jsbin.com/rawepuk/edit?js,console,output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://jsbin.com/jexoda/edit?html,js,console | |
https://jsbin.com/juheze/edit?js,console | |
https://jsbin.com/tuqokec/edit?js,console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://jsbin.com/ceribe/edit?js,console | |
https://jsbin.com/menuhu/edit?js,console | |
https://jsbin.com/yebiqa/edit?js,console |