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
drill 1 | |
href="https://jsbin.com/jehiyes/embed?js,console" | |
drill 2 | |
https://jsbin.com/rawebir/edit?js,console | |
drill 3 | |
https://jsbin.com/sifawow/edit?js,console | |
drill 4 | |
https://jsbin.com/dudinex/edit?js,console | |
drill 5 | |
https://jsbin.com/jegixi/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
drill 1 | |
https://jsbin.com/fenonuq/edit?js,console | |
drill 2 | |
https://jsbin.com/yejarip/edit?js,console | |
drill 3 | |
https://jsbin.com/sunuboz/edit?js,console | |
drill 4 | |
https://jsbin.com/jijarix/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? Your explanation should include the idea of global vs. local scope. | |
JavaScript has two scopes: global and local. A variable that is declared outside a function definition is a global variable, and its value is accessible and modifiable throughout your program. A variable that is declared inside a function definition is local | |
Why are global variables avoided? | |
Global variables are accessible through out the program and their value can be manipulated unwantedly which causes error. That is why global variables are avoided. | |
Explain JavaScript's strict mode | |
JavaScript strict mode changes silent mistakes to throw erroes.It doesn't allow any variable to get initialize without proper delaration. | |
What are side effects, and what is a pure function? | |
A pure function doesn't depend on and doesn't modify the states of variables out of its scope. Concretely, that means a pure function always returns the same result given same parameters. | |
Explain variable hoisting in JavaScript. | |
The behaviour of js interpreter |
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
<h1>Drill 1<h1/> | |
<a class="jsbin-embed" href="https://jsbin.com/woyefo/embed?js,console">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script> | |
<h1>Drill 2<h1/> | |
<a class="jsbin-embed" href="https://jsbin.com/lobolob/embed?js,console">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script> | |
<h1>Drill 3<h1/> | |
<a class="jsbin-embed" href="https://jsbin.com/nigeke/1/embed?js,console">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script> | |
<h1>Drill 4<h1/> | |
<a class="jsbin-embed" href="https://jsbin.com/qelazu/5/embed?js,console">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script> | |
<h1>Find<h1/> | |
<a class="jsbin-embed" href="https://jsbin.com/wiwijac/1/embed?js,output">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script> |
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/getecu/edit?js,console,output | |
Errors | |
https://jsbin.com/saqeca/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
AreaOfRectangle | |
function computeArea(width, height) { | |
// your code here | |
return width*height | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
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
WisePersonGenerator | |
function wisePerson(wiseType, whatToSay) { | |
// your code here | |
var str = 'A wise ' + wiseType + ' once said: "' + | |
whatToSay + '".'; | |
return str; | |
} | |
/* From here down, you are not expected to |
NewerOlder