poetries.github.io
poetries.github.io copied to clipboard
JS 中的 call、apply、bind 方法 | Poetry's Blog
http://blog.poetries.top/2016/12/13/call-apply-bind/
call()、apply()、bind()都是函数对象的一个方法,它们的作用都是改变函数的调用对象。它的使用极大的简化了代码的调用 一、方法定义 call方法 语法 1fun.call(thisArg[, arg1[, arg2[, ...]]]) thisArg:fun函数运行时指定的this值,可能的值为: 不传,或者传null,undefined, this指向window对象 传递