3 ms·
kinda already possible: const bind1st = (f, x) => (y) => f(x, y) const addTwo = bind1st(add, 2) let x = addTwo(5) // 7 it can get a little confusing unless on
by contras1970 9y ago
kinda already possible:
const bind1st = (f, x) => (y) => f(x, y)
const addTwo = bind1st(add, 2)
let x = addTwo(5) // 7
it can get a little confusing unless one's used to point-free programming:
const twostep = bind1st(bind1st, bind1st) // YMMV