I have an object that looks like this:
{
"1": "Technology",
"2": "Startup",
"3": "IT",
}
and I need to convert it to an array of objects that would look like this:
[
{id: 1, name: "Technology"},
{id: 2, name: "Startup"},
{id: 3, name: "IT"}
]
What would be the cleanest & efficient way to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…