I have two arrays that look like this:
array1 = [1, 2, 3, 4, 5];
array2 = [a, b, c, d, e];
Using JavaScript, I want to convert two arrays of same length into array of objects that would look like this:
newArrayofObjects = [ {key1: 1, key2: a}, {key1: 2, key2: b}, {key1: 3, key2: c}, {key1: 4, key2: d}, {key1: 5, key2: e}]
forloop