I have two arrays
const time = ['00:00', '00:30', '01:00', '01:30']
const cost = [1.40, 5.00, 2.00, 3.00]
And I want to merge them into an array of objects with keys like so:
result = [
{
time: '00:00',
cost: 1.40
},
{
time: '00:30',
cost: 5.00
},
{
time: '01:00',
cost: 2.00
},
{
time: '01:30',
cost: 3.00
}
]