Better method of retrieving values of checked input boxes via jQuery?
<p>I have several checkboxes and a fake submit button to make an AJAX request:</p>

<pre><code>&lt;form&gt;
    &lt;input type="checkbox" value="1"/&gt;
    &lt;input type="checkbox" value="2" checked="checked"/&gt;
    &lt;input type="checkbox" value="3"/&gt;
    &lt;input type="checkbox" value="4" checked="checked"/&gt;
    &lt;input type="button" onclick="return mmSubmit();"/&gt;
&lt;/form&gt;
</code></pre>

<p>Within the mmSubmit() method, I would like to retrieve an array of values that have been selected.  Here is what I am currently doing.</p>

<pre><code>mmSubmit = function() {
    var ids = [];
    $('input[type=checkbox]:checked');.each(function(index) {
        ids.push($(this).attr('value'));
    });
    // ids now equals [ 2 , 4 ] based upon the checkbox values in the HTML above
    return false;
};
</code></pre>

<p>I'm wondering if there is a shorthand method in jQuery used to retrieve the values into an array, or if what I have is already optimal.</p>
