title: weird array.length alternative syntax
body: <p>this had me surprised:</p>
  
  <pre><code>var parts = email.split('@');
  if (parts &lt; 2) {
  </code></pre>
  
  <p>reference: <a href="https://github.com/Kicksend/mailcheck/blob/master/src/jquery.mailcheck.js#L21-22" rel="nofollow">https://github.com/Kicksend/mailcheck/blob/master/src/jquery.mailcheck.js#L21-22</a></p>
  
  <p>essentially, it looks like:</p>
  
  <pre><code>var a = [null, null, null]
  a &lt; 2 // false
  
  var b = [null]
  b &lt; 2 // true
  </code></pre>
  
  <p>so it seems like it works but I want to know why, what coercion actually happens for it to do this? as the intent here was to bail if less than 2 parts come from the email string, i would have expected it to always pass due to the array defined being truthy - it ought to create an array with at least 1 member even on an empty string.</p>
  
  <p>i would always prefer to use <code>array.length</code>. is the above safe?</p>