@@iterator
属性的初始值是和 Array.prototype.values
属性的初始值相同的对象。
语法
arguments[Symbol.iterator]()
实例
使用for...of
循环的迭代
function f() { // 你的浏览器必须支持 for..of 循环 // 以及 for 循环中的 let 区域变量 for (let letter of arguments) { console.log(letter); } } f('w', 'y', 'k', 'o', 'p');
规范
浏览器兼容
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out
https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@iterator |
Chrome Full support 52 | Edge Full support 12 | Firefox Full support 46 | IE No support No | Opera Full support Yes | Safari Full support 9 | WebView Android Full support 52 | Chrome Android Full support 52 | Firefox Android Full support 46 | Opera Android Full support Yes | Safari iOS Full support 9 | Samsung Internet Android Full support 6.0 | nodejs Full support Yes |
Legend
- Full support
- Full support
- No support
- No support