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 | ✅ | no | ✅ |
Object.values | ✅ | no | ✅ |
Object.entries | ✅ | no | ✅ |
Object.getOwnPropertyNames | no | no | ✅ |
Object.getOwnPropertySymbols | no | ✅ | no |
Reflect.ownKeys | no | ✅ | ✅ |