70.手写一个偏函数
Opened this issue · 0 comments
webVueBlog commented
const partial = (fn, ...restArgs) => {
return (...args) => fn(...restArgs, ...args);
};
function partial(func, ...restArgs) {
return function(...args) {
return func.call(this, ...restArgs, ...args);
}
}