JS: Reflect.ownKeys

By Xah Lee. Date: . Last updated: .

(new in ECMAScript 2015)

Reflect.ownKeys(obj)

Return a Array of the object's keys. (including Symbol keys and non-enumerable keys.)

// list all properties of a object

console.log(Reflect.ownKeys({ "y": 3, [Symbol("x")]: 4 }));
// [ "y", Symbol(x) ]

JavaScript. Object Properties to Array