-
Notifications
You must be signed in to change notification settings - Fork 0
/
calculatingWithFunctions.js
60 lines (52 loc) · 1.11 KB
/
calculatingWithFunctions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function zero(operator = null) {
return operator ? operator(0) : 0;
}
function one(operator = null) {
return operator ? operator(1) : 1;
}
function two(operator = null) {
return operator ? operator(2) : 2;
}
function three(operator = null) {
return operator ? operator(3) : 3;
}
function four(operator = null) {
return operator ? operator(4) : 4;
}
function five(operator = null) {
return operator ? operator(5) : 5;
}
function six(operator = null) {
return operator ? operator(6) : 6;
}
function seven(operator = null) {
return operator ? operator(7) : 7;
}
function eight(operator = null) {
return operator ? operator(8) : 8;
}
function nine(operator = null) {
return operator ? operator(9) : 9;
}
function plus(b) {
return function(a) {
return a + b;
};
}
function minus(b) {
return function(a) {
return a - b;
};
}
function times(b) {
return function(a) {
return a * b;
};
}
function dividedBy(b) {
return function(a) {
return Math.floor(a / b);
};
}
/*
*/