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 drill - https://jsbin.com/sulize/edit?js,console | |
normalizer drill - https://jsbin.com/culojep/edit?js,console | |
shouter drill - https://jsbin.com/mazuno/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
computeArea - https://jsbin.com/vemehiv/edit?js,console | |
Temperature Conversion - https://jsbin.com/hufaje/edit?js,console | |
Modulo drill - https://jsbin.com/yaxehos/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/luyefom/edit?js,output | |
Error Handling - https://jsbin.com/kivenic/1/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
make an array - https://jsbin.com/qatizuj/edit?js,console,output | |
using .push - https://jsbin.com/roziri/edit?js,console,output | |
accesing items - https://jsbin.com/nuwoha/edit?js,console,output | |
using .length - https://jsbin.com/hizoke/edit?js,console,output | |
copy I - https://jsbin.com/bifase/edit?js,console,output | |
copy II - https://jsbin.com/sujaci/edit?js,console,output | |
using .map - https://jsbin.com/hoticil/edit?js,console,output | |
using .sort - https://jsbin.com/noliqi/edit?js,console,output | |
using .filter - https://jsbin.com/lacaxez/edit?js,console,output | |
using .find - https://jsbin.com/ruxefi/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
max/min- https://jsbin.com/yapelir/edit?js,console,output | |
average- https://jsbin.com/fodevim/edit?js,console,output | |
fizzbuzz- https://jsbin.com/kuzupe/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
Q1: What is scope? | |
'Scope' refers to the places that a variable can be called on in javascript. A variable with 'local scope' is one that | |
is defined within a specific function, and can only be used within that function. If it is used elsewhere without being | |
redefined, you'll get an uncaught ref error. A variable with 'global scope' is one that is defined outside of a function. | |
variables with global scope can be called on anywhere in your code, even between files. | |
Q2: Why are global variables avoided? | |
Global variables are to be avoided because they cause a lot of bugs. The reason they cause a lot of bugs is because you can | |
accidentally mutate them in a function, and then when you call on them again later, the mutated data held by the variable | |
is not what you were expecting. By keeping your variables local, you're creating a variable and then directly working with it, |
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/diguso/edit?html,js,output | |
https://jsbin.com/wumoxa/edit?js,console,output | |
https://jsbin.com/jumifaw/edit?js,console,output | |
https://jsbin.com/xacuwod/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/jamicur/edit?js,console,output | |
https://jsbin.com/wimeto/edit?js,console,output | |
https://jsbin.com/recevi/edit?js,console,output | |
https://jsbin.com/qiwowi/edit?js,console,output | |
https://jsbin.com/waxutos/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
This code starts out by declaring a function they call getTokens, which just parses the raw text that is input and | |
breaks it down into a usable form: all lowercase, as an array without any punctuation, without any | |
falsy items (no null, undefined, etc), and sorted alphabetically. | |
Then it declares the main function, mostFrequentWord. This function is where you'll input the chunk of text you want to analyze | |
first, it sets a variable called words that runs the aforementioned getTokens function - what this does is sets our words | |
variable to be a nice clean list (array) of words in alphabetical order. Then it sets up an empty object called wordFrequencies, where | |
we're going to hold the wordcount data as we go along. | |
Next, it loops through each item on the words list. It checks to see if we already have an entry (key) for that word in our |
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://glitch.com/edit/#!/precious-robin?path=server.js:21:0 | |
https://glitch.com/edit/#!/mighty-antler?path=server.js:21:0 | |
https://glitch.com/edit/#!/nimble-factory?path=server.js:29:48 |
OlderNewer