实现简单的bind函数.md Posted on 2018-03-10 模拟传参实现1234567Function.prototype.bind = function (...args) { const self = this const bindTarget = args.shift() return function (...args1) { return self.apply(bindTarget, [...args, ...args1]) }} 完整版perf: 加上构造函数作用域实现12345678Function.prototype.bind = Function.prototype.bind || function (context, ...args1) { const self = this const fBound = function (...args2) { return self.apply(context, [...args1, ...args2]) } fBound.prototype = this.prototype return fBound}