We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

@@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');

规范

规范 状态 备注
ECMAScript 2015 (6th Edition, ECMA-262)
CreateUnmappedArgumentsObject
Standard 初始定义.
ECMAScript 2015 (6th Edition, ECMA-262)
CreateMappedArgumentsObject
Standard 初始定义.
ECMAScript Latest Draft (ECMA-262)
CreateUnmappedArgumentsObject
Draft  
ECMAScript Latest Draft (ECMA-262)
CreateMappedArgumentsObject
Draft  

浏览器兼容

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
基础支持 52 46 (46) ? ? 9
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
基础支持 ? ? 46.0 (46) ? ? ?

更多

文档标签和贡献者

此页面的贡献者: wizardforcel, wohugb
最后编辑者: wizardforcel,