why is [ ]==0 in java script? : <pre><code>Code:   
a=[1,2];   
b=[];

if(b==0){    
    console.log('0')    
}  
if(a==2){   
    console.log('2')  
}  
if([]==0){  
console.log('3')  
}  

Output:  
0  
3
</code></pre>

<p>in case if  [ ] is considered as an array of length 0 and == is comparing [ ] to its length.Why is [1,2]==2 false?</p>
