关于call()、apply()、bind()

JS 还提供了一种供开发者自定义 this 的方式,它提供了 3 种方式。

  • Function.prototype.call(thisArg, argArray)
  • Function.prototype.apply(thisArg [, arg1 [, args2, ...]])
  • Function.prototype.bind(thisArg [, arg1 [, args2, ...]])

详细讲解:

https://segmentfault.com/a/1190000017747952?utm_source=tag-newest

posted on 2019-08-02 09:16  半分可爱与温柔啊  阅读(85)  评论(0编辑  收藏  举报

导航