I have the following object :
let categories = {
"Asset Type": ["appliances", "electronics"],
"Asset Availability": ["in stock"]
}
I need to convert it to the following structure :
[
{
"name": "Asset Type",
"values": ["Appliances", "Electronics"]
},
{
"name": "Asset Availability",
"values": ["In Stock"]
}
]
Reflect.ownKeys). If you just want the result to be dependable, you can use any of the object iteration methods - although the spec doesn't guarantee it, environments use the same algorithm anyway, luckily. (array indicies, followed by insertion order strings, followed by insertion order symbols)