The initial value of the
@@iterator
property is the same function object as the initial value of the
Array.prototype.values
特性。
arguments[Symbol.iterator]()
for...of
loop
function f() {
// your browser must support for..of loop
// and let-scoped variables in for loops
for (let letter of arguments) {
console.log(letter);
}
}
f('w', 'y', 'k', 'o', 'p');
| 规范 |
|---|
|
ECMAScript (ECMA-262)
The definition of 'CreateUnmappedArgumentsObject' in that specification. |
|
ECMAScript (ECMA-262)
The definition of 'CreateMappedArgumentsObject' in that specification. |
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@iterator
|
Chrome 52 | Edge 12 | Firefox 46 | IE No | Opera 39 | Safari 9 | WebView Android 52 | Chrome Android 52 | Firefox Android 46 | Opera Android 41 | Safari iOS 9 | Samsung Internet Android 6.0 | nodejs Yes |
完整支持
不支持