I have an object array like this one:
[{"key":"fruit","value":"apple"},{"key":"color","value":"red"},{"key":"location","value":"garden"}]
I need to convert it to the following format:
[{"fruit":"apple"},{"color":"red"},{"location":"garden"}]
How is this possible using javascript?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…