function partial(fn, ...args) { return function(...newArgs) { return fn.apply(this, args.concat(newArgs)); }; }
Функции высшего порядка в Lodash
Dmitry Gershun
1102

Можно еще короче и ES6-нее:

function partial(fn, ...args) {
return (...newArgs) => {
return fn(...args, ...newArgs);
};
}
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.