SOURCE

function partial(fn,...presetArgs) {
    return function partiallyApplied(...laterArgs){
        return fn( ...presetArgs, ...laterArgs );
    };
}
function add(x,y) {
    return x + y
}

console.log([1,2,3].map(partial(add,3)));
// console.log([1,2,3].map(item => partial(add,3)(item)))
console 命令行工具 X clear

                    
>
console