I have an object which has objects inside in it at the following form:
Object {
"item1": { "subitem1": 5, "subitem2": 10 },
"item2": { "subitem1": 3, "subitem2": 12, "subitem3": 1 },
"item3": { "subitem1": 8, "subitem2": 1, "subitem3": 3 }
}
I want to convert it to an array with the following form:
[0] Object { key: "item1", "subitem1": 5, "subitem2": 10 }
[1] Object { key: "item2", "subitem1": 3, "subitem2": 12, "subitem3": 1 }
[2] Object { key: "item3", "subitem1": 8, "subitem2": 1, "subitem3": 3 }
Any ideas? Thanks in advance
item1, at least not according to the specifications. The answers may work by accident but can break at any moment if implementation of JS interpreter changes.