function partialUsingArguments(fn) {
//拿到partialUsingArguments的第一个参数之后的全部参数
let pArr=[...arguments].slice(1);
//定义函数
let result=function(){
//使用apply方法调用函数,参数位pArr及result函数的参数相加而得的数组
//所以使用concat方法将两个函数的参数数组连接起来:pArr.concat([...arguments])
return fn.apply(this,pArr.concat([...arguments]));
}
return result;
}
京公网安备 11010502036488号