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
rest和arguments都可以获取多余参数。
rest
arguments
...rest
length
arguments对象
rest参数
function foo (a, ...b, c) {} // ×错的
阮一峰ES6
The text was updated successfully, but these errors were encountered:
No branches or pull requests
rest
和arguments
都可以获取多余参数。arguments
是获取全部传进来的参数rest
参数(...rest
) 是获取声明的参数之外的参数arguments
是类数组,只有length
和索引元素,...rest
获取的是货真价实的数组arguments对象
arguments
有多种属性,具体可以查MDNrest参数
rest
参数后面不能再写参数:length
属性,不包括rest参数参考
阮一峰ES6
The text was updated successfully, but these errors were encountered: