K_Artem,
function test() { return arguments }
var test1_3 = partialAny(test, 1, undefined, 3);
console.log(test1_3(5)); // 1,5,3
console.log( partialAny(test, 1)(2, 3))// [1, 2, 3]
// Моя функция
function partialAny(...arg) {
let [fn, ...arrFixArgs] = arg;
return function (...arg) {
let j = 0;
let arrArgs = arrFixArgs.map((e, i) => e === undefined ? arg[j++] : e)
arrArgs = arrArgs.concat(arg.slice(j));
return fn.apply(this, arrArgs);
}
}