My question is similar to the one found here: Merging keys array and values array into an object using JavaScript
However, I am unable to find a solution for my specific scenario. If I have these two arrays:
const keys = ['x', 'y', 'z'];
const values = [
[0, 1, 2],
[10, 20, 30],
];
How can I merge them into an array of objects to achieve the desired output?
[
{
x: 0,
y: 1,
z: 2,
},
{
x: 10,
y: 20,
z: 30,
},
]