Skip to content

Instantly share code, notes, and snippets.

View verdi327's full-sized avatar
💭
Thinkful EI

Michael Verdi verdi327

💭
Thinkful EI
View GitHub Profile
@verdi327
verdi327 / questions.txt
Created March 28, 2019 13:44
Initial Jquery Questions
1) How often is Jquery used now that other frontend libs like React have become so popular? They seem to propose different philosophies
on how updates should be made to html pages.
2) Need to see more examples of using js- prefixed classes to better understand how to create an abstraction layer between js code and css code.
3) Is Jquery mostly used for mostly traversal and manipulation?
.... I don't have any other questions currently!
@verdi327
verdi327 / most-frequent-word-analysis.js
Created March 21, 2019 21:19
Most frequent word analysis
function getTokens(rawString) {
// NB: `.filter(Boolean)` removes any falsy items from an array
// Overall goal is to sanitize the text and return an array of the words
// 1) converts all characters to lowercase
// 2) splits the string when it encounters various delimiters like a space or punctuation
// 3) removes any falsy values from the array
// 4) sorts the words alphabetically
return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort();
}
@verdi327
verdi327 / object-drills-pt2.txt
Created March 21, 2019 21:02
Object Drills pt2
https://repl.it/@verdi327/Make-student-reports-drill
https://repl.it/@verdi327/Enroll-in-summer-school-drill
https://repl.it/@verdi327/find-by-id-drill
https://repl.it/@verdi327/validate-object-keys-drill
@verdi327
verdi327 / object-drills-pt1
Created March 21, 2019 20:31
Object Drills pt 1
https://repl.it/@verdi327/Object-creator-drill
https://repl.it/@verdi327/Self-reference-drill
https://repl.it/@verdi327/Deleting-keys-drill
https://repl.it/@verdi327/Deleting-keys-drill
@verdi327
verdi327 / explaining-scope.txt
Last active March 21, 2019 20:19
Explaining Scope
What is scope? Your explanation should include the idea of global vs. local scope.
Scope is the accessibility of data within the execution of a program. When the JS interpreter executes a file, it
looksup variables within its scope chain. "This" represents the current scope. And if the declared variable is not
found in the current scope the parent scope is checked. All the way up the chain until the global scope is checked.
Why are global variables avoided?
Global variables should be avoided because they lead to bad programming practices. Functions should be deterministic and free
from side effects. By using global variables, you can access data in non-obvious ways which can lead to functions behaving
differently based on the state of global variables. This can lead to buggy code that is hard to fix.
@verdi327
verdi327 / array drills pt 3
Created March 21, 2019 19:34
array drills pt 3
https://repl.it/@verdi327/min-and-max-without-sort-drill
https://repl.it/@verdi327/average-drill
https://repl.it/@verdi327/fizzbuzz-drill-js
@verdi327
verdi327 / array drills pt 2
Created March 21, 2019 19:19
array drills pt 2
https://repl.it/@verdi327/Array-copying-I-drill
https://repl.it/@verdi327/Array-copying-II-drill
https://repl.it/@verdi327/Squares-with-map-drill
https://repl.it/@verdi327/Sort-drill
https://repl.it/@verdi327/Filter-drill
https://repl.it/@verdi327/Find-drill
@verdi327
verdi327 / array drills
Created March 21, 2019 18:58
Array Drills
https://repl.it/@verdi327/Creating-arrays-drill
https://repl.it/@verdi327/Adding-array-items-drills
https://repl.it/@verdi327/Accessing-array-items-drill
https://repl.it/@verdi327/Array-length-and-access-drill
@verdi327
verdi327 / control flow
Created March 21, 2019 18:50
Control Flow
https://repl.it/@verdi327/Traffic-lights-drill
https://repl.it/@verdi327/Error-alert-drill
@verdi327
verdi327 / number_drills
Created March 21, 2019 17:36
Number Drills
https://repl.it/@verdi327/area-of-a-rectangle-drill
https://repl.it/@verdi327/temperature-conversion-drill
https://repl.it/@verdi327/Is-divisible-drill