Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
326 changes: 326 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions paperproblems/anonymous-functions/problem1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ function greet(x) {
console.log("hello " + x);
}

var greet = function(x) {console.log("hello " + x);}
var bob = "bob"

greet(bob);
4 changes: 3 additions & 1 deletion paperproblems/anonymous-functions/problem2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ In other words, replace all the function definitions with anonymous functions
The final program should be on a single line


function greet(x) {
function (x) {
console.log("hello " + x);
}

Expand All @@ -12,3 +12,5 @@ function call(f) {
}

call(greet);

(function (x) {console.log("hello " + x);})("bob")
3 changes: 3 additions & 0 deletions paperproblems/anonymous-functions/problem3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ function call(f) {
}

call(greet);


(function (x, y) {console.log("hello " + x + " " + y)})("Bob", "Dole")
4 changes: 3 additions & 1 deletion paperproblems/anonymous-functions/problem4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ function twice(f) {
f("mary");
}

twice(greet);
twice(greet);

twice(function(x){console.log("hello " + x);})
5 changes: 4 additions & 1 deletion paperproblems/anonymous-functions/problem5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ function soften(f) {

var softAskOnADate = soften(askOnADate);
console.log(softAskOnADate("Eric"));
console.log(softAskOnADate("Bob"));
console.log(softAskOnADate("Bob"));

Bob = I do
Eric = Maybe
5 changes: 4 additions & 1 deletion paperproblems/array-functions/problem1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ var dogs = animals.filter(
function(animal)
{return animal.species === 'dog';});

console.log(dogs.length);

console.log(dogs.length);

2
4 changes: 3 additions & 1 deletion paperproblems/array-functions/problem2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ var letterN = animals.filter(function(animal) {
return animal.name !== undefined && animal.name[0] === 'N'
});

console.log(letterN[0].name);
console.log(letterN[0].name);

Nacho
Loading