Does jQuery or a jQuery plugin have a function that does what this function does?
<p>I would like to know if jQuery or a jQuery plugin has a function that does what the following function does:</p>

<pre><code>function $array(a /* an ARRAY */, f /* a function */) {
    var $res = $();
    for (var i = 0; i &lt; a.length; ++i)
        /* Notice: The result of evaluating f(a[i])
         *         shall always be a jQuery selector
         */
        $res.add(f(a[i]));
    return $res;
}
</code></pre>

<p>I find this function very useful, but I don't want to reimplement it if it already exists.</p>

<hr>

<p><strong>EDIT 1:</strong></p>

<p>I admit the question was not particularly clear. I want to be able to do something like:</p>

<pre><code>$('&lt;select&gt;')
.append($array([
    { value: 0, name: 'Item 0' },
    { value: 1, name: 'Item 1' },
    { value: 2, name: 'Item 2' }
], function(option) {
    return $('&lt;option&gt;')
    .val(option.value)
    .html(option.name);
}))
.appendTo('body');
</code></pre>
