三者都是用来改变函数的this对象的指向的

fun.call(this,a,b);   //相当于 this.fun(a,b)

fun.apply(this,[a,b]); //相当于 this.fun(a,b);

fun.bind(this);   // 返回 this.fun 

fun.bind(this)();  //相当于 this.fun();

 

相关文章:

  • 2021-12-31
  • 2022-12-23
  • 2021-03-10
猜你喜欢
  • 2021-07-11
  • 2021-09-21
  • 2021-08-27
  • 2022-03-08
  • 2021-09-19
  • 2021-12-02
  • 2021-12-24
  • 2021-12-03
相关资源
相似解决方案