I currently have an object structured as follows:
{"label":["Option 1","Option 2","Option 3"],"share":[0.0650068849312104,0.00873977167120444,0.00873977167120444]}
My goal is to transform this object into an array with the following format:
[{label: "Option 1", share: 0.0650068849312104}, {label: "Option 2", share: 0.00873977167120444}, {label: "Option 3", share: 0.00873977167120444}]
The new array should consist of objects matching the number of data points in the original object.
Given my limited experience with JavaScript, I am struggling with this task. I have tried researching solutions, including using object.keys(), but I still haven't been able to figure it out. Could someone please provide guidance on how to achieve this conversion and mapping?
Any assistance would be greatly appreciated!
Edit: reference to JSON has been removed