In what way can this object be manipulated to rearrange values.
let obj = [
{foo: 10, bar: 20},
["apple"],
{foo: 30, bar: 40},
["pear"],
{foo: 50, bar: 60},
["orange"]
]
// The output should be:
// { "apple": { foo: 10, bar: 20 }, "pear": {...}, "orange": {...} }
I've tried the solution as provided here: loop and combine every two items
But that doesn't output the desired output.