js实现bind

Function.prototype.bind=function(ctx,...lastArgs){
       let self=this
       return (...laterArgs)=>self.apply(ctx,lastArgs.concat(laterArgs))
}    

  

posted @ 2019-07-29 23:10  dawn~monster  阅读(99)  评论(0编辑  收藏  举报