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 in ECMAScript 2016 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
Not part of any standard.
Browser compatibility
Not supported anywhere. Historically supported in Firefox 12 till 14.