In Javascript a dictionary comprehension, or an Object `map`
<p>I need to generate a couple of objects from lists in Javascript. In Python, I'd write this:</p>

<pre><code>{key_maker(x): val_maker(x) for x in a_list}
</code></pre>

<p>Another way to ask is does there exist something like <code>jQuery.map()</code> which aggregates objects? Here's my guess (doesn't work):</p>

<pre><code>var result = {}
$.map(a_list, function(x) {
    $.extend(result, {key_maker(x): val_maker(x)})
})
</code></pre>
