I have source data in the following format (object of arrays):
{
value: [
59, 58, 62, 58, 56, 57, 57, 65, 81, 81
],
dayOfWeek: [
'Thursday', 'Friday', 'Saturday', 'Thursday', 'Friday', 'Friday',
'Friday', 'Monday', 'Friday', 'Tuesday'
],
dayOrNight: [
'N', 'D', 'N', 'D', 'D', 'N', 'N', 'N', 'N', 'N'
]
}
And I want the data transformed into the following format (array of objects):
[
{
value: 59,
dayOfWeek: 'Thursday',
dayOrNight: 'N'
},
{
value: 58,
dayOfWeek: 'Friday',
dayOrNight: 'D'
},
{
value: 62,
dayOfWeek: 'Saturday',
dayOrNight: 'N'
},
...
]
This is kinda the opposite of this question.
What is the appropriate combination of commands to do this, whether using e.g. lodash or otherwise?