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
定义一个函数mul
function mul(a,b){ return this+(a*b); }
接着我们在控制台上打印出
console.log(mul.call(null,2,3)); console.log(mul.call('s',2,3)); console.log(mul.call(3,2,3)); console.log(mul.apply(null,[2,5])); console.log(mul.apply(2,[2,5]));
分别为:
[object Window]6 s6 9 [object Window]10 12
function.apply(obj, arg)
function(arg) this = obj
The text was updated successfully, but these errors were encountered:
No branches or pull requests
定义一个函数mul
接着我们在控制台上打印出
分别为:
function.apply(obj, arg)
function(arg) this = obj
The text was updated successfully, but these errors were encountered: