-
-
Save dtinth/fad72fb92b22e66d9f26dec00e04c282 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const 管 = (a, f) => f(a) | |
const plus = (n) => (x) => x + n | |
const times = (n) => (x) => x * n | |
const ops = [ plus(1), times(2) ] | |
ops.reduce(管, 9) // 20 | |
ops.reduceRight(管, 9) // 19 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment