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
Questions | |
What is scope? Your explanation should include the idea of global vs. local scope. | |
Scope defines how a variable may be accessed, or not accessed, at different points in the code. There are two types of scope: | |
global scope and local scope. A variable declared outside a function is considered global scope and is able to be accessed | |
through-out your code. A variable declared within a function is considered local scope and can only be accessed within the | |
function to where it resides. | |
Why are global variables avoided? | |
Global variables can cause uninteded side effects causing the code to be indeterminate which can yield different output given | |
the same imput. Thereby creating code that can be difficult to debug. |
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
Square Area: http://jsbin.com/vezucav/edit?html,js,console | |
Temperature Conversion: http://jsbin.com/rocapis/edit?html,js,console | |
Is Divisible: http://jsbin.com/woxuli/edit?html,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
Wiseperson generator: http://jsbin.com/liyaweb/edit?html,js,console | |
Shouter: http://jsbin.com/lavezu/edit?html,js,console | |
Text normalizer: http://jsbin.com/coxopun/edit?html,js,console |