pandaomeng / gitalk-comment

使用gitalk存储博客的评论
0 stars 0 forks source link

js 的 apply, call 和 bind | 无趣的小帕 #45

Open pandaomeng opened 5 years ago

pandaomeng commented 5 years ago

https://www.pandaomeng.com/2019/04-05-apply-call-bind/

js 的 apply, call 和 bind call call() 方法调用一个函数, 其具有一个指定的this值和分别地提供的参数(参数的列表)。 apply apply() 方法调用一个具有给定this值的函数,以及作为一个数组(或类似数组对象)提供的参数 bind bind()方法创建一个新的函数,在调用时设置this关键字为提供的值。并在调用新函数时,将给定参数列表作为原