[] == ![] evaluates to true
<p>I would like to know why the expression given in the title </p>

<p><code>[] == ![]</code> </p>

<p>is evaluated to <code>true</code>.</p>

<p>You cannot compare arrays as strings. I get that. If </p>

<p><code>[] == []</code></p>

<p>will evaluate to false because the references are different. Though if we have the following statement. </p>

<pre><code>var arr = []; 
arr == arr // this evaluates to true simply because references are the same.
</code></pre>

<p>In order A == B to return <code>true</code> either A and B have to be <code>false</code> or <code>true</code>.
A == !B  in order to return <code>true</code>  A can be <code>true</code> and B can be <code>false</code> or vice versa but in this case, A  and B are the same values so I don't get it.</p>