title: Underscore.js: create a map out of list of objects using a key found in the object
body: <p>I am using the excellent <a href="http://underscorejs.org/">Underscore.js</a> library. I have a specific task which I can do fine using JavaScript or jQuery but was wondering if there was some sort of abstraction avaialable in Underscore that I was missing out on.</p>
  
  <p>Essentially I have an object like so - </p>
  
  <pre><code>var some_object_array = [{id: "a", val: 55}, {id: "b", val: 1}, {id: "c", val: 45}];
  </code></pre>
  
  <p>I want to convert this into -</p>
  
  <pre><code>var some_map = {"a": {id: "a", val: 55}, "b": {id: "b", val: 1}, "c": {id: "c", val: 45}};
  </code></pre>
  
  <p>I know that I can use <code>_.groupBy(some_object_array, "id")</code>. But this returns a map like so -</p>
  
  <pre><code>var some_grouped_map = {"a": [{id: "a", val: 55}], "b": [{id: "b", val: 1}], "c": [{id: "c", val: 45}]};
  </code></pre>
  
  <p>Note that this does what it is advertised to do. But I was hoping to get <code>some_map</code> without iterating over the objects myself.</p>
  
  <p>Any help appreciated.</p>