题解 | #_bind函数#

Function.bind

http://www.nowcoder.com/practice/ecad0164931847f78c55278cee56e544

Function.prototype._bind = function(context){
	context = context || window;
    let fn = this;
    let args = [...arguments].slice(1);
    return function(){
    	return fn.call(context, ...args, ...arguments);
    }
}
全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务