I want to convert the following array:
const data = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]];
to the following object:
const data = [
{
a: 1,
b: 2,
c: 3,
d: 4
},
{
a: 5,
b: 6,
c: 7,
d: 8
},
{
a: 9,
b: 10,
c: 11,
d: 12
}
];
How do I do it using loop or some other way, of course?
Array.prototype.mapandArray.prototype.reduce