title: Create an object from an array of keys and an array of values
body: <p>I have two arrays: <code>newParamArr</code> and <code>paramVal</code>.</p>
  <p>Example values in the <code>newParamArr</code> array: <code>[ &quot;Name&quot;, &quot;Age&quot;, &quot;Email&quot; ]</code>.</p>
  <p>Example values in the <code>paramVal</code> array: <code>[ &quot;Jon&quot;, 15, &quot;jon@gmail.com&quot; ]</code>.</p>
  <p>I need to create a JavaScript object that places all of the items in the array in the same object. For example <code>{ [newParamArr[0]]: paramVal[0], [newParamArr[1]]: paramVal[1], ... }</code>.</p>
  <p>In this case, the result should be <code>{ Name: &quot;Jon&quot;, &quot;Age&quot;: 15, &quot;Email&quot;: &quot;jon@gmail.com&quot; }</code>.</p>
  <p>The lengths of the two arrays are always the same, but the length of arrays can increase or decrease. That means <code>newParamArr.length === paramVal.length</code> will always hold.</p>
  <p>None of the below posts could help to answer my question:</p>
  <p><a href="https://stackoverflow.com/questions/11827456/javascript-recursion-for-creating-a-json-object">Javascript Recursion for creating a JSON object</a></p>
  <p><a href="https://stackoverflow.com/questions/15690706/recursively-looping-through-an-object-to-build-a-property-list">Recursively looping through an object to build a property list</a></p>