Skip to content

Instantly share code, notes, and snippets.

View bigtankjr's full-sized avatar

Benjamin Levels bigtankjr

  • Torrance, CA
View GitHub Profile
@bigtankjr
bigtankjr / Challenge: analyze a most frequent word program
Created September 27, 2018 18:26
Challenge: analyze a most frequent word program
function getTokens(rawString) {
// NB: `.filter(Boolean)` removes any falsy items from an array
return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort();
//recieve a string of text
function mostFrequentWord(text) {
//use getTokens function to remove falsy characters and get specific words from text
@bigtankjr
bigtankjr / Objects drills 2
Created September 27, 2018 17:43
Objects drills 2
https://repl.it/@benlevels/Make-student-reports-drill
https://repl.it/@benlevels/Enroll-in-summer-school-drill
https://repl.it/@benlevels/find-by-id-drill
https://repl.it/@benlevels/validate-object-keys-drill
@bigtankjr
bigtankjr / Object drills 1
Created September 27, 2018 03:59
Object drills 1
https://repl.it/@benlevels/Object-creator-drill
https://repl.it/@benlevels/Object-updater-drill
https://repl.it/@benlevels/Self-reference-drill
https://repl.it/@benlevels/Deleting-keys-drill
@bigtankjr
bigtankjr / Challenge: In your own words
Created September 26, 2018 23:04
Challenge: In your own words
1.) What is scope? Your explanation should include the idea of global vs. local scope.
Scope is the area within the context or boundaries of a program where behavior and state can be defined and implemented.
The context of global scope would be the entire program; whereas local scope's boundaries are within functions inside of
the program.
2.)Why are global variables avoided?
Global variables are often avoided because they can cause unwanted side effects within your program than can be difficult
to diagnose as the application grows. An example would be variables defined in the scope of the entire application that are
also used inside functions. When these functions sharing the same variables as those declared globally are initialized,
the global variable can be changed. Other functions relying on the global variable may cause unwanted errors or changes
@bigtankjr
bigtankjr / Arrays and Loops Drills
Created September 26, 2018 21:22
Arrays and Loops Drills
https://repl.it/@benlevels/min-and-max-without-sort-drill
https://repl.it/@benlevels/average-drill
https://repl.it/@benlevels/fizzbuzz-drill-js
@bigtankjr
bigtankjr / Array method drills
Created September 26, 2018 20:46
Array method drills
https://repl.it/@benlevels/Sort-drill
https://repl.it/@benlevels/Squares-with-map-drill
https://repl.it/@benlevels/Array-copying-II-drill
https://repl.it/@benlevels/Array-copying-I-drill
https://repl.it/@benlevels/Filter-drill
https://repl.it/@benlevels/Find-drill
@bigtankjr
bigtankjr / Array basics drills
Created September 26, 2018 19:09
Array basics drills
https://repl.it/@benlevels/Array-length-and-access-drill
https://repl.it/@benlevels/Accessing-array-items-drill
https://repl.it/@benlevels/Adding-array-items-drills
https://repl.it/@benlevels/Creating-arrays-drill
@bigtankjr
bigtankjr / Logic drills
Created September 26, 2018 18:18
Logic drills to practice Error control flow.
https://repl.it/@benlevels/Error-alert-drill
https://repl.it/@benlevels/Traffic-lights-drill
@bigtankjr
bigtankjr / Number Drills
Created September 26, 2018 17:46
Number Drills to practice using formulas to manipulate numbers
https://repl.it/@benlevels/Is-divisible-drill
https://repl.it/@benlevels/temperature-conversion-drill
https://repl.it/@benlevels/area-of-a-rectangle-drill
@bigtankjr
bigtankjr / String drills
Created September 26, 2018 17:34
String drills using function to manipulate strings
https://repl.it/@benlevels/text-normalizer-drill
https://repl.it/@benlevels/shouter-drill
https://repl.it/@benlevels/Wiseperson-generator-drill