I'm trying to convert an object where the property values are arrays to an array of objects where each object has the same properties as the original, but the values are from the arrays.
For example, given the following array:
fruit = [{
"apple": [2, 3],
"orange": [2, 3]
}]
I would like:
fruit = [{
"apple": 2,
"orange": 2
},
{
"apple": 3,
"orange": 3
}
]
How should I accomplish this with JavaScript?