How to transform a flat array-like sequence to an associative map?
<p>Essentially, I want an equivalent of this Python function in JavaScript:</p>

<pre><code>def to_dict(coll, key):
    return {i[key]: i for i in coll}

assert to_dict([
    {'key': 1, 'value': 1},
    {'key': 2, 'value': 2},
    {'key': 3, 'value': 3},
], 'key') == {
    1: {'key': 1, 'value': 1},
    2: {'key': 2, 'value': 2},
    3: {'key': 3, 'value': 3},
}
</code></pre>

<p>I know I can construct it by hand, but is there a concise way? (jQuery or Underscore.js can be used)</p>
