apply-call-bind
call: var foo ={ value:1 } function bar(name,age) { console.log(this.value); console.log(name); console.log(age); } //bar.call(foo,'gongtao',11); Function.prototype.call2 = function (context) { var args = []; for (var i = 1, len = arguments.length; i < len; i++) { args.push(arguments[i]); } context.fn = this; context.fn(...args); delete context.fn; } bar.call2(foo,'gongtao',111); apply: var foo = { value: 1 } function bar(name, age) { console.log(this.value); console.log(name); console.log(age); } //bar.apply(foo); Function.prototype.apply2 = function (context, arr) { var context = context ||