Reflect.enumerate()

这篇翻译不完整。请帮忙从英语翻译这篇文章

已废弃
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.

语法

Reflect.enumerate(target)

参数

target
The target object on which to get the property.

返回值

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

Exceptions

A TypeError, if target is not an Object.

描述

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

案例

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)
Reflect.enumerate
Standard Initial definition. Removed in ECMAScript 2016.

Browser compatibility

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

See also

文档标签和贡献者

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