Skip to content

Instantly share code, notes, and snippets.

https://repl.it/@travelingtonic/Wiseperson-generator-drill
https://repl.it/@travelingtonic/shouter-drill
https://repl.it/@travelingtonic/text-normalizer-drill
https://repl.it/@travelingtonic/area-of-a-rectangle-drill
https://repl.it/@travelingtonic/temperature-conversion-drill
https://repl.it/@travelingtonic/Is-divisible-drill
@travelingtonic
travelingtonic / logic-drills
Created October 22, 2018 15:37
Logic Drills 2.3.2
https://repl.it/@travelingtonic/Traffic-lights-drill
https://repl.it/@travelingtonic/Error-alert-drill
@travelingtonic
travelingtonic / array-drills
Created October 22, 2018 17:38
Array drills
https://repl.it/@travelingtonic/Creating-arrays-drill
https://repl.it/@travelingtonic/Adding-array-items-drills
https://repl.it/@travelingtonic/Accessing-array-items-drill
https://repl.it/@travelingtonic/Array-length-and-access-drill
@travelingtonic
travelingtonic / array-method-drills
Created October 22, 2018 19:52
Array Method Drills
https://repl.it/@travelingtonic/Array-copying-I-drill
https://repl.it/@travelingtonic/Array-copying-II-drill
https://repl.it/@travelingtonic/Squares-with-map-drill
https://repl.it/@travelingtonic/Sort-drill
https://repl.it/@travelingtonic/Filter-drill
https://repl.it/@travelingtonic/Find-drill
@travelingtonic
travelingtonic / loop-drills
Created October 23, 2018 13:16
Loop Drills
https://repl.it/@travelingtonic/min-and-max-without-sort-drill
https://repl.it/@travelingtonic/average-drill
https://repl.it/@travelingtonic/fizzbuzz-drill-js
@travelingtonic
travelingtonic / global-variables
Created October 23, 2018 13:58
Global Variable Scope
What is scope? Your explanation should include the idea of global vs. local scope.
Variable scope defines how declared variables can be accessed or changed. Global scope variables are defined outside of a function block and can be accessed or changed from anywhere in the same file or even in another file. Block variables are defined within a function block and can only be accessed or changed from within that function block.
Why are global variables avoided?
Global variables can lead to unintended side effects, such as a function could change the value of a global variable unintentionally. Using global variables can cause code to be hard to understand, can make a function indeterminate if it returns different results in some situations vs others, and is hard to troubleshoot.
Explain JavaScript's strict mode.
Strict mode can be defined in a function but preferably is defined at the top of each JavaScript file. Strict mode ensures that all variable defintions must be defined with const or let so that blo
@travelingtonic
travelingtonic / object-drills
Created October 23, 2018 14:36
Object Drills 1 and 2
Drill 1:
https://repl.it/@travelingtonic/Object-creator-drill
https://repl.it/@travelingtonic/Object-updater-drill
https://repl.it/@travelingtonic/Self-reference-drill
https://repl.it/@travelingtonic/Deleting-keys-drill
Drill 2:
https://repl.it/@travelingtonic/Make-student-reports-drill
https://repl.it/@travelingtonic/Enroll-in-summer-school-drill
@travelingtonic
travelingtonic / objChallenge
Created October 25, 2018 12:03
Object Challenge
Get all the text and convert to lower case then remove? any punctuation marks.
create an array to store all the words in the text
loop through the text array and if a given word is already in the text count array increment its count by 1. If a given word is not already in the text count array then add it to the array with a count of 1.
set first item in word count array as the highest max word and count
loop through each word in the word count array against the current highest and if higher count than current set highest to new current word
At end of loop return back the highest count word and its count
@travelingtonic
travelingtonic / virtual-pet-lunar
Created October 25, 2018 16:57
My Virtual Pet
Toni's pet: https://glitch.com/edit/#!/lunar-whippet?path=public/client.js:38:25
Requirements: https://www.thinkful.com/workshops/city/virtual-pet/
Original Source code: https://glitch.com/edit/#!/cherry-restaurant?path=public/client.js:1:0
Solution: https://glitch.com/edit/#!/tf-virtual-pet-solution?path=public/client.js:1:0