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 refers where and when variables are accesible. There are two types of scope, Global and local (aka function scope). | |
Understanding how scope works cuts down on bugs in your program. | |
Global scope is accessible outside of a Function. They are available everywhere. | |
e.g. | |
var x = 'foo'; | |
function doSomething() { | |
console.log(x); | |
} // foo (available in Global Scope) |
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
// max and min // | |
https://jsbin.com/jotujal/2/edit?js,console | |
// compute the average // | |
https://jsbin.com/haviqox/1/edit?js,console | |
// fizzbuzz // | |
https://jsbin.com/qokujif/4/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
// creating arrays // | |
https://jsbin.com/wotofe/2/edit?js,console | |
// adding array items // | |
https://jsbin.com/yekunax/2/edit?js,console | |
// accessing array items // | |
https://jsbin.com/zuseqib/2/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
// traffic lights // | |
https://jsbin.com/tusitar/2/edit?js,console,output | |
// error alert // | |
https://jsbin.com/figuciv/1/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
// square area // | |
https://jsbin.com/gazofe/2/edit?js,console | |
// temperature conversion // | |
https://jsbin.com/loqavi/2/edit?js,console | |
// is divisible // | |
https://jsbin.com/seracim/2/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
// wiseperson // | |
https://jsbin.com/fenidak/2/edit?js,console | |
// shouter // | |
https://jsbin.com/dotadi/2/edit?js,console | |
// text normalizer // | |
https://jsbin.com/jixipuz/2/edit?js,console |
NewerOlder