How is an array reference into an empty string + true a valid character in JavaScript?
<p>I'm not sure what is happening in this line of javascript:</p>

<pre><code>alert( (''+[][[]])[!+[]+!+[]] ); // shows "d"
</code></pre>

<p>What I've figured out:</p>

<pre><code>var a = ! + []; // == true
var b = ! + [] + ! + []; // == 2
</code></pre>

<p>It seems that the second part is a reference into an array of letters or some sort, but I don't understand how that is coming from </p>

<pre><code>(''+[][[]])
</code></pre>

<p>Also:</p>

<pre><code>alert( (''+[][])[2] ); // nothing happens; console says "unexpected token ]"
alert( (''+[[]][])[2] ); // nothing happens; console says "unexpected token ]"
alert( (''+[[]][[]])[2] ); // shows "d"
alert( (""+true)[2] ); // shows "u"
</code></pre>
