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 "What's your github clone URL?" | |
read URL | |
git remote add upstream $URL | |
git fetch upstream |
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
# Solution 2.2 of foo.bar | |
def solution(h, q): | |
# We'll use a dictionary to hold the | |
# solutions so that we can store as | |
# q[x] = soln and later return back | |
# in order, regardless of how our | |
# algorithm iterates through the tree. | |
solutions = {} |
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
// Type JavaScript here and click "Run Code" or press Ctrl + s | |
console.log('Hello, world!'); | |
// CHALLENGE 1 | |
function sumFunc(arr) { | |
// YOUR CODE HERE | |
let accumulator = 0; | |
for (let i = 0; i < arr.length; i++) { | |
accumulator += arr[i]; |
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
// Destructuring === Arrays | |
var [a,b] = [1,2]; | |
console.log(a,b); | |
//=> 1 2 | |
// Omit certain values | |
var [a, , b] = [1, 2, 3]; | |
console.log(a, b); | |
// 1 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
{"name": "Rusty", "room":"kitchen", "weapon":"candlestick"} | |
const obj = {name, weapon} |
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
// Create an object using bracket and dot notation that represents the characters and related data you may find in a game of Clue. | |
var game = {}; | |
game.murderer = "??"; | |
game['weapons'] = [ | |
{type: 'lasers', location: 'lab'}, | |
{type: 'angry cats' ...}, | |
{... 'dish soap' ...} | |
]; |
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
// CHALLENGE 1 // | |
function createFunction() { | |
return function(){ | |
console.log('hello'); | |
} | |
} | |
// UNCOMMENT THESE TO TEST YOUR WORK! | |
var function1 = createFunction(); |
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
/////////////////////////////////////////////////////////////////// | |
//CHALLENGE 1// | |
console.log('Start of Challenge 1'); | |
console.log('I am at the beginning of the code'); | |
function setTimeoutFunc() { | |
console.log('I am in the setTimeout callback function'); | |
} | |
setTimeout(setTimeoutFunc, 0); |
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
// Challenge 1 | |
function addTwo(num) { | |
return num+2 | |
} | |
/////////////////////////////////////////////////////////////////////////////////////// | |
// Challenge 2 | |
function addS(word) { | |
return word + 's' |
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
/**************************************************************** | |
WORKING WITH OBJECT LITERALS | |
****************************************************************/ | |
/*** CHALLENGE 1 of 1 ***/ | |
function makePerson(personName, personAge) { | |
let newPerson = Object.create(null); | |
newPerson.name = personName; | |
newPerson.age = personAge; | |
return newPerson |
NewerOlder