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
----- ANALOGY OF CLIENT AND SERVER ----- | |
A simple analogy of client and server might be an interaction between a student and a teacher. | |
A student, Becky, is preparing a presentation on blue whales but does not have all the information she needs to create a detailed, clear, and visual presentation. Becky and her presentation is a client in this case. Luckily, Becky has a trusty teacher, Mr. Shure, she can visit to ask questions. Her teacher in this case is a server. | |
Becky asks her Mr. Shure for facts, where she can find books, and visuals on blue whales. Becky asking her teacher for information is a request. Her teacher responds by providing her with a sheet of paper that contains a written list of blue whale facts, titles and authors of books on these amazing creatures, and search queries for sites with images of blue whales swimming in the world's oceans. This written list a response. | |
With the list of facts, books, and search queries for images, Becky is able to compile a beautiful presenation. This pres |
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
// HEADLINE | |
Hello, I'm Peter. I'm a full-stack developer, UX enthusiast, and avid learner. | |
// BIO | |
I'm a recent graduate of the Engineering Flex boot camp at Thinkful. I believe that curiosity and openness are at the root of self-discipline and diligence. These traits are the catalysts that afford us the ability to tackle problems. Coding to me is a skill set that will allow for simple to complex solutions. | |
When I'm not coding, I'm often found traveling to new cities, visiting museums and gardens, relaxing on a lounge chair reading, or making candles. My current learning projects include starting a small business and writing my first book. |
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
Google Drive link | |
https://drive.google.com/drive/folders/1z8iz6w-sG9RgF5wUSVjC6UDqkL-PVdhi?usp=sharing |
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
function getTokens(rawString) { | |
// NB: `.filter(Boolean)` removes any falsy items from an array | |
return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort(); | |
} | |
// create a function called 'mostFrequentWord' with argument 'text'. | |
function mostFrequentWord(text) { | |
// declare the variable 'words' to 'getTokens(text)'. | |
let words = getTokens(text); | |
// declare the variable 'wordFrequencies' as an object. |
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://repl.it/@PeterYoon/Deleting-keys-drill |
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
/* how come we can't use console.log instead of return? */ | |
https://repl.it/@PeterYoon/Self-reference-drill |
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
/* i originally wrote 'return updateObject()'. Realized that in the instructions it asked to return it. It stands for obj. */ | |
https://repl.it/@PeterYoon/Object-updater-drill |
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
/* the toughest part is knowning when the use a comma or a semi colon */ | |
https://repl.it/@PeterYoon/Object-creator-drill |
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
Q: What is scope? Your explanation should include the idea of global vs. block scope. | |
A: Scope defines which part of the code can access a particular variable. A variable in a global scope is available everywhere. Any variable that is declared outside of a function has a global scope. A variable in a block scope is limited to a set of instructions within a function. This appears to be what a local scope is. | |
Q: Why are global variables avoided? | |
A: (1) Debugging Issues: Global variables are avoided because it can cause issues down the line where debugging can be difficult. Every function has access to them and as the code base becomes large it becomes increasingly difficult to figure our which functions read and write these variables. (2) Difficult Collaboration: It makes it harder to pass around different functions as it would take a lot of time to understand which functions interact with the global variable. | |
Q: Explain JavaScript's strict mode | |
A: Strict mode disallows for global variables, essentially catch |
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
/* repl: https://repl.it/@PeterYoon/fizzbuzz-drill-js | |
function fizzBuzz(countTo) { | |
let fbList = []; | |
for (let i = 1; i <= countTo; i++) { | |
if (i % 3 === 0 && i % 5 === 0) { | |
fbList.push('fizzbuzz'); | |
} else if (i % 3 === 0) { | |
fbList.push('fizz'); |