callapply均用于this值绑定,区别在于参数列表

Function.apply(thisObj, args)
Function.call(thisObj, [param1[, param2 [, param3 [... [,paramN]]]]])

前者传入参数列表(arguments),后者挨个向里边放参数

callapply方法可以将一个函数的对象上下文从出事的上下文改编为由thisObj指定的新对象

此章作为this指向章节的补充
JavaScript中call&&apply详解(番外)

相关文章:

  • 2021-06-01
  • 2021-10-17
  • 2021-10-06
  • 2022-12-23
  • 2021-06-05
猜你喜欢
  • 2021-07-22
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
相关资源
相似解决方案