I am working with an array of objects that looks like this:
[
{ "key": "fruit", "value": "apple" },
{ "key": "color", "value": "red" },
{ "key": "location", "value": "garden" }
]
My goal is to transform it into the following format:
[
{ "fruit": "apple" },
{ "color": "red" },
{ "location": "garden" }
]
Could someone provide guidance on how to achieve this using JavaScript?