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) ]


ECMAScript® 2016 Language Specification#sec-reflect.ownkeys

back to JS: Reflect

Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

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

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Reference
  5. DOM
  6. SVG
  7. Web Dev Blog