过时
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.

静态 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.

异常

A TypeError , if target is not an Object .

描述

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

范例

使用 Reflect.enumerate()

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

规范

Not part of any standard.

浏览器兼容性

Not supported anywhere. Historically supported in Firefox 12 till 14.

另请参阅

元数据

  • 最后修改: