I have 2 arrays that i want to "reduce" into 1 object.
so for instance:
I have..
var originalData = [1,2,3];
var newData = [3,1,2];
i want to combine these two arrays into an object that looks like this:
var newOrderObject = {1:3, 2:1, 3:2};
im using a reduce function but it seems to be mapping them differently
var newOrderObject = originalData.reduce(function(newData) {
var orderObject = {};
originalData = newData;
return orderObject;
}, {});
any suggests would be appretiated