The equality test (==) in JavaScript is notoriously confusing. Based on a table by Mr. Naohiko Mori, I added two more rows and columns for an empty array ("[]") and an array with zero in it ("[0]").
Table

And just for comparison, here is the table with results from the more strict test (===). Note that for arrays, left hand side and right hand side are different instances. If they are the same instance, the results are true (this is true for both ways of testing).
Table

Source code is available at: https://github.com/yoshikiohshima/JS-Equality