title: How to convert an array of objects to object with key value pairs
body: <p>I want to convert an array of objects to object with key value pairs in javascript.</p>
  
  <pre><code>var arr=[{"name1":"value1"},{"name2":"value2"},...}];
  </code></pre>
  
  <p>How can i convert it to an object such as</p>
  
  <pre><code>{"name1":"value1","name2":"value2",...}
  </code></pre>
  
  <p>I want it to be supported in majority of browsers.</p>