Skip to content

Instantly share code, notes, and snippets.

View secilreel's full-sized avatar
:octocat:
Build'n Ship

secilreel

:octocat:
Build'n Ship
View GitHub Profile
function wisePerson(wiseType, whatToSay) {
return `A wise ${wiseType} once said: "${whatToSay}".`;
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
function computeArea(width, height) {
return width*height;
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
function doTrafficLights() {
const activeLight = getActiveLight();
if(activeLight === 'red') {
turnRed();
}
if(activeLight === 'yellow'){
turnYellow();
}
if(activeLight === 'green'){
turnGreen();
https://repl.it/@secilreel/Creating-arrays-drill
https://repl.it/@secilreel/Adding-array-items-drills
https://repl.it/@secilreel/Accessing-array-items-drill
https://repl.it/@secilreel/Array-length-and-access-drill
https://repl.it/@secilreel/Array-copying-I-drill
https://repl.it/@secilreel/Array-copying-II-drill
https://repl.it/@secilreel/Squares-with-map-drill
https://repl.it/@secilreel/Sort-drill
https://repl.it/@secilreel/Filter-drill
https://repl.it/@secilreel/Find-drill
https://repl.it/@secilreel/min-and-max-without-sort-drill
https://repl.it/@secilreel/average-drill
https://repl.it/@secilreel/fizzbuzz-drill-js
Scope defines where Java Script can find a variable. If the variable is defined within a function, it has a block scope.
Otherwise, if the variable is outside of a function, it has a global scope. Global Scopes should be avoided because it might
change variables in other parts of the code, even outside of the original file. This is an undesirable side effect.Side
effects happen when a function reaches outside of its local scope and up into its parent; and, alters a value that is in there.
A side effect might create an indeterminate code, meaning a code that might not give the same result every time it runs.
To debug such a code would be both hard and frustrating. Instead, it is a good practice to have pure codes, which have no side
effects and are determinate, meaning they give the same result every time it runs. In order to avoid undesired side effects,
and not change variables in the global scope, it is a good practice to write 'strict mode' at the top of Java Script. Strict
mode will only allow chang
https://repl.it/@secilreel/Object-creator-drill
https://repl.it/@secilreel/Object-updater-drill
https://repl.it/@secilreel/Self-reference-drill
https://repl.it/@secilreel/Deleting-keys-drill
https://repl.it/@secilreel/Make-student-reports-drill
https://repl.it/@secilreel/Enroll-in-summer-school-drill
https://repl.it/@secilreel/find-by-id-drill
https://repl.it/@secilreel/validate-object-keys-drill
@secilreel
secilreel / gist:08945ac1c89175cc10440dd249213a90
Created December 11, 2018 15:16
Most Frequent Word Drill
https://repl.it/@secilreel/most-frequent-word-analyzer-challenge