I'm about to use forOwn
to iterate through an object's properties and create an array manually and can't helping thinking there's a oneliner already available to do it.
{
prop1 : "value",
prop2: { sub:1}
}
to:
[
{key: "prop1", value: "value"},
{key: "prop2", value: {sub:1}}
]
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…