我们的志愿者还没有将这篇文章翻译为 中文 (简体)。加入我们帮助完成翻译!
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 |