JS: Reflect.ownKeys

By Xah Lee. Date: . Last updated: .

New in ES2015.

Reflect.ownKeys ( obj )

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

[see JS: Symbol Tutorial]

[see JS: Property Attributes, writable, enumerable, configurable]

[see JS: List Properties]

const obj = {
 "y": 3,
 [Symbol("x")] : 4,
};

// list all properties of a object
console.log( Reflect.ownKeys(obj) ); // prints [ 'y', Symbol(x) ]

back to JS: Reflect

Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials