Вышла из употребления
Эта возможность вышла из употребления. Хотя она может продолжать работать в некоторых браузерах, её использование не рекомендуется, поскольку она может быть удалена в любое время. Старайтесь избегать её использования.
Функция Reflect
.enumerate()
возвращает итератор который может использоваться для перечисления собственных и наследованных свойств объекта, но был удален в ECMAScript 2016 и отмечен как устаревший.
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
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) Определение 'Reflect.enumerate' в этой спецификации. |
Стандарт | Initial definition. Removed in ECMAScript 2016. |
Browser compatibility
No compatibility data found. Please contribute data for "javascript.builtins.Reflect.enumerate" (depth: 1) to the MDN compatibility data repository.