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
Get all: db.restaurants.find(); | |
Limit & Sort: | |
This didn't work: | |
db.restaurants.find({name: 1}).sort({name: 1}).limit(10); | |
This did: | |
db.restaurants.find({borough: "Manhattan"}, {name: 1}).sort({name: 1}).limit(10); | |
WHY? |
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
Echo Endpoint: | |
- https://glitch.com/edit/#!/blaze-jury?path=server.js:10:31 | |
MadLibs: | |
- https://glitch.com/edit/#!/dust-peak?path=server.js:15:5 | |
A/B Test: | |
- https://glitch.com/edit/#!/possible-velvet?path=server.js:18:15 |
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
Testing 1 2 3 |
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
High Level Definition of App Idea: | |
Using the http://api.fantasy.nfl.com/ API, my app helps users compare the stats of 2 different players at a certain position in order to | |
determine which player to select for their fantasy football draft. |
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
Cat Carousel: https://jsbin.com/sumejo/edit?html,js,output | |
2nd attempt: https://jsbin.com/daseroy/edit?html,js,output | |
Return of Fizzbuzz: https://jsbin.com/nanojo/edit?html,js,output - doesn't work, not close, but are you kidding me? I was supposed to | |
come up with THAT solution?! | |
Lightbulb Toggle: https://jsbin.com/fefiter/edit?html,css,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
getTokens fxn: | |
1. Gets passed in a string. | |
2. The string then: | |
- gets converted to all lowercase letters. | |
- gets split into an array of strings of each individual word. A regular expression is used to split the string at a space, a comma, | |
an exclamation point, a period, a quotation mark, a semicolon, a colon, or a dash. | |
- has any "falsy" items removed from the array. | |
- gets alphabetically sorted. | |
3. An array of alphabetically sorted strings is returned. Each string contains a single word. |
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 Student Reports: https://jsbin.com/rapugej/edit?js,console | |
Enroll in Summer School: https://jsbin.com/wogohec/2/edit?js,output | |
Find by ID: https://jsbin.com/pexeciz/edit?js,console | |
Validate Object Keys: https://jsbin.com/nejiqef/2/edit?js,output | |
Todo List Factory: |
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
First Answer, without reviewing the Lessons or using Google: | |
1. What is scope? Your explanation should include the idea of global vs. local scope. | |
- Scope is where a variable or set of variables are defined and contained. Global scope sets a variable for the entire codebase. Local | |
scope is contained within the fxn where it is used. Also it's much better than Listerine. | |
2. Why are global variables avoided? | |
- If you're bringing in third-party libraries, such as jQuery, using an API, or merging with someone else's code, it can/will cause |
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
Object Creator: https://jsbin.com/wubojod/edit?js,console | |
Object Updater: https://jsbin.com/joxofu/edit?js,console | |
Self Reference: https://jsbin.com/xabixez/edit?js,console | |
Deleting Keys: https://jsbin.com/fagidiz/edit?js,console - Why does it log the key/values to the console in alphabetical order by key, | |
instead of the order in which they were listed in the code? | |
- Side effect? |
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
min and max (without sort): https://jsbin.com/rovanaf/edit?js,console - Close, but not quite! | |
Compute the Average: https://jsbin.com/zesixi/edit?js,console - Took awhile, but got it! | |
FizzBuzz: https://jsbin.com/vahexah/edit?js,console - Didn't have divisible by 5 AND 3 first in the if statement. |