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
原题
call传递参数,是一个一个传的。
call
.call(this, 1, 2, 3);
apply传递参数,直接传一个数组。
apply
.apply(this, [1, ,2, 3])
性能的话,貌似call好一些,因为省去了把数组解构的过程。
又看了大家说的,call可以这样:
var a = [1, 2, 3]; fn.call(null, ...a)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
原题
区别
call
传递参数,是一个一个传的。apply
传递参数,直接传一个数组。性能的话,貌似call好一些,因为省去了把数组解构的过程。
又看了大家说的,call可以这样:
The text was updated successfully, but these errors were encountered: