Partial application of arguments to function.
-
fn - {Function}
The function -
arg1, arg2, ... - {*}
Partially applied arguments
{Function} - The function with supplied arguments partially applied
function sum(x, y) {
return x + y;
}
const sum1 = partial(sum, 1);
sum(1, 2); // 3
sum1(2); // 3
sum1(4); // 5
Fork the repo and send pull requests.
npm test
to run tests, npm run lint
to run eslint