Is there a way to combine these two arrays into one?
array1 = [
{ image: 'image1', title: 'title1' },
{ image: 'image2', title: 'title2' },
{ image: 'image3', title: 'title3' },
];
array2 = [
{ downloadLink: 'downloadLink1', fileName: 'fileName1' },
{ downloadLink: 'downloadLink2', fileName: 'fileName2' },
{ downloadLink: 'downloadLink3', fileName: 'fileName3' },
];
The desired output is:
array3 = [
{ image: 'image1', downloadLink: 'downloadLink1', fileName: 'fileName1' },
{ image: 'image2', downloadLink: 'downloadLink2', fileName: 'fileName2' },
{ image: 'image3', downloadLink: 'downloadLink3', fileName: 'fileName3' },
];