I have a dilemma with two arrays that have been structured as follows:
arr1 = [10, 20, 30, 40, 50];
arr2 = ['x', 'y', 'z', 'w', 'v'];
My goal is to utilize JavaScript in order to transform these arrays of equal length into an array consisting of objects arranged like so:
newArrayOfItems = [ {id: 10, letter: 'x'}, {id: 20, letter: 'y'}, {id: 30, letter: 'z'}, {id: 40, letter: 'w'}, {id: 50, letter: 'v'}]