SOURCE

Function.prototype.bind = function (context, ...arg) {
    const self = this;
    return function (...more) {
        const params = [...arg, ...more];
        self.apply(context, params);
    }
}

function text(a, b) {
    console.log(a, b, this.c);
}

const module = {c: 100};
const a = text.bind(module, 2);

a(4);

console 命令行工具 X clear

                    
>
console