title: Convert 2 element list into dict in Javascript
body: <p>I am having 2 element list which is like this,</p>
  
  <pre><code>a = ['first_name', 'user']
  b = ['last_name', 'abcd']
  </code></pre>
  
  <p>I want to convert it into,</p>
  
  <pre><code>{
    'first_name' : 'user',
    'last_name' : 'abcd'
  }
  </code></pre>
  
  <p>This is what I tried:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>a = ['first_name', 'user']
  b = ['last_name', 'abcd']
  new_dict = {}
  new_dict[a[0]] = a[1]
  new_dict[b[0]] = b[1]
  console.log(new_dict)</code></pre>
  </div>
  </div>
  </p>
  
  <p>Are there any simple/native JS method than this?</p>