JavaScript: List Properties
Object to Array
To list properties of a object, use one of the following methods.
Method | enumerable only | include Symbol key | include string key |
---|---|---|---|
Object.keys | yes | no | yes |
Object.values | yes | no | yes |
Object.entries | yes | no | yes |
Object.getOwnPropertyNames | no | no | yes |
Object.getOwnPropertySymbols | no | yes | no |
Reflect.ownKeys | no | yes | yes |
[see Property Attributes]