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