-
-
Save KaeruCT/8941118 to your computer and use it in GitHub Desktop.
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
// six(dividedBy(two())) == 3 | |
var self = this; | |
['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'].forEach(function (el, i) { | |
self[el] = (function (i) { | |
return function (op) { | |
return op ? op(i) : i; | |
}; | |
}(i)); | |
}); | |
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 a / b;}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment