We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
都属于Function构造函数原型上的方法Function.prototype。
Function.prototype
call()调用一个函数,其具有一个指定的this值和参数列表。 apply()调用一个函数,其具有一个指定的this值,以及作为一个数组(或类似数组的对象)提供的参数。
call()
this
apply()
var arr = [1,10,2,8]; Math.max.call(Math,...arr); Math.max.apply(Math,arr);
bind()创建一个新函数,当调用时,将其this关键字设置为提供的值,在调用新函数时,在任何提供之前提供一个给定的参数序列。 call和apply都是为了动态改变this,当一个object没有某个方法,
bind()
call
apply
The text was updated successfully, but these errors were encountered:
No branches or pull requests
都属于Function构造函数原型上的方法
Function.prototype
。用途
call()
调用一个函数,其具有一个指定的this
值和参数列表。apply()
调用一个函数,其具有一个指定的this
值,以及作为一个数组(或类似数组的对象)提供的参数。bind()
创建一个新函数,当调用时,将其this
关键字设置为提供的值,在调用新函数时,在任何提供之前提供一个给定的参数序列。call
和apply
都是为了动态改变this,当一个object没有某个方法,The text was updated successfully, but these errors were encountered: