`
shangtang004
  • 浏览: 31527 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

bind and apply call difference

阅读更多

 

Function.prototype.bind=function(obj){

  var _method = this;

return function(){

_method.apply(obj,arguments);

}

}

 

call和apply差不多,只是call参数是一个个arg,而apply是arguments.

 

The difference is that bind returns a function reference that can be used later, rather than the result of an immediate execution that we get with call.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics