I have two arrays namely a and b. I want to combine first value of a and first value of b as one array and that continues. (i.e)
a = ["05:25 PM", "3:05 PM"];
b = [60, 120];
Desired Output:
['05:25 PM', 60],
['3:05 PM', 120]
I have combined two array but it's not coming as expected
a = ["05:25 PM", "3:05 PM"];
b = [60, 120];
const result = a.map((id, i) => ({ x: id, y: b[i] }));
console.log(result);