get a total of jquery's .each()
<p>I'm using jquery's .each() to iterate over a group of li's. I need a total of all the li's matched. Is the only way to create a count variable outside the .each() and increment this inside the .each()? It doesn't seem very elegant.</p>

<pre><code>var count;
$('#accordion li').each(function() {
    ++count;
});  
</code></pre>
