Skip to content

Instantly share code, notes, and snippets.

View djl-gg's full-sized avatar
🎯
Focusing

dj djl-gg

🎯
Focusing
View GitHub Profile
@djl-gg
djl-gg / Array.prototype.map and map();
Created September 11, 2015 17:59
Exercise 4 Reactive
Array.prototype.map = function(projectionFunction) {
var results = [];
this.forEach(function(itemInArray) {
results.push(projectionFunction(itemInArray));
});
return results;
};
Queue Builder
The devs at Poplar Puzzles would like you to treat an array of functions like a
Queue, passing the result of each function into the next until the Queue is empty.
They’ve sent you the puzzlers Queue of functions, and the following instructions:
Build a function and assign it to a variable named applyAndEmpty.
The function should take in an input number and a queue of functions as parameters.
Using a for loop, call the functions in the queue in order with the input
number, where the results of each function becomes the next function’s input.
The folks over at Poplar Puzzlers need an array of functions for one of their puzzles. They’ve requested your help in making the array, which they would like to be called puzzlers. The cells of the array should each contain a function, and these functions–well, what they return–are listed here in order. Each function has one parameter. Note input below represents the parameter, and you will need to convert the math formulas to JavaScript:
Returns 3 * input - 8
Returns (input + 2)3
Returns input2 - 9
Returns input % 4
Use your knowledge of arrays and anonymous function expressions to build this array of functions.
Note: Use parentheses with your return statements if you’re having trouble with the order of operations.
@djl-gg
djl-gg / djl.md
Created September 1, 2015 04:00
danieljoonlee's bio
@djl-gg
djl-gg / index.html
Created August 25, 2015 20:55
Portfolio - HTML Test
<!doctype html>
<html lang="en">
<head>
<title>Bootstrap Layouts</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
</head>