Considerations in deciding whether to compare a jQuery object's length to zero in a conditional
<p>When using the presence or absence of specific elements on the page as part of a conditional, I can see two ways of doing it using jQuery's <code>length</code> property that are functionally equivalent.  I'm trying to determine what the benefits and drawbacks are to each approach.</p>

<p>A</p>

<pre><code>if ($('.foo').length) { /* do stuff */ }
</code></pre>

<p>B</p>

<pre><code>if ($('.foo').length &gt; 0) { /* do stuff */ }
</code></pre>

<p>With A, there's a coercion to boolean, but it saves on typing and bits over the wire.  It may not be as clear what's going on to other developers less familiar with what data that property contains and with how JS coercion works.</p>

<p>With B, it's more readable, coercion-free, and more tedious to type and read, and sends more bits over the wire.</p>

<p>Those are the benefits and drawbacks as I see them.  What I'm asking is whether there are additional considerations I missed that should be weighed in deciding which style to go with.</p>