JS基础总结 - call apply bind 方法对比

 

  参数1 参数2及之后参数 返回
.call( ) `this`绑定的对象 参数 执行结果
.apply( ) `this`绑定的对象 参数的数组 执行结果
.bind( ) `this`绑定的对象 参数 函数

 

 

示例:

// apply
add.apply(null, [1, 2]);

 

posted @   Better-HTQ  阅读(47)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示