GitHub 6248★

Partially apply a function

JavaScript version

const partial =
(fn, ...a) =>
(...b) =>
fn(...a, ...b);

Examples

const sum = (x, y) => x + y;
const inc = partial(sum, 1);
inc(9); // 10
Follow me on and to get more useful contents.