Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Reflect.enumerate()

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The static Reflect.enumerate() method used to return an iterator with the enumerable own and inherited properties of the target object, but has been removed from the ECMAScript standard in edition 7 and is deprecated in browsers.

Syntax

Reflect.enumerate(target)

Parameters

target
The target object on which to get the property.

Return value

An iterator with the enumerable own and inherited properties of the target object.

Exceptions

A TypeError, if target is not an Object.

Description

The Reflect.enumerate method returns an iterator with the enumerable own and inherited properties of the target object.

Examples

Using Reflect.enumerate()

var obj = { x: 1, y: 2 };

for (var name of Reflect.enumerate(obj)) {
  console.log(name);
}
// logs "x" and "y"

Specifications

Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Reflect.enumerate' in that specification.
Standard Initial definition. Removed in ECMAScript 2016 (ES7).

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support No support No support No support No support No support
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support No support No support No support No support No support No support

See also

文档标签和贡献者

 此页面的贡献者: fscholz, gingerik
 最后编辑者: fscholz,