Created
May 25, 2021 05:32
-
-
Save nickciolpan/3133c517004c6faa5ba82bceb0aea60c 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
// www.codewars.com/kata/525f3eda17c7cd9f9e000b39 | |
const curry = (operand, operator) => (!operator) ? operand : operator(operand); | |
const [zero, one, two, three, four, five, six, seven, eight, nine] = | |
[0,1,2,3,4,5,6,7,8,9].map(operand => ((operator) => curry(operand, operator))); | |
const plus = (first) => (second) => second + first; | |
const minus = (first) => (second) => second - first; | |
const times = (first) => (second) => second * first; | |
const dividedBy = (first) => (second) => Math.floor(second / first); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment