Double ternary in JavaScript
<p>I was going through some stuff in the jQuery source, specifically the <code>inArray</code> method and I found this line of code:</p>

<pre><code>i = i ? i &lt; 0 ? Math.max( 0, len + i ) : i : 0;
</code></pre>

<p>What I am seeing is two ternary operators, but I have no idea how this is used.  I understand how the ternary operator works, but I have never seen it used like this before. How does this piece of code work??</p>
