I'd like to convert an object to an array of smaller, single-property objects in Javascript. For example:
x={
a: {a1:"a1", a2:"a2"},
b: {b1:"b1", b2:"b2"},
c: {c1:"c1", c2:"c2"}
}
converted to
y=[
{a: {a1:"a1", a2:"a2"}},
{b: {b1:"b1", b2:"b2"}},
{c: {c1:"c1", c2:"c2"}}
]
I know this is possible with loops, but I was wondering if there is a more elegant way. I'm using underscore/lo-dash if they help.