I am working with two arrays:
['x', 'y', 'z']
And array 2:
[{ x: 5, y: 10, z: 15, w: 20 }]
Is there a way to merge these two arrays to get the following output:
[{x: 5, y: 10: z: 15}]
I only want the items present in the first array. Any suggestions for an efficient solution?