Boolean comparison in JavaScript has a bug
A few days ago, a colleague pointed out some unexpected behavior in JavaScript. After a few hours of investigation this weekend I think I have found the cause: a bug in boolean comparison. This post shows my investigation and will help you to reach that same conclusion. A tricky question What does the following expressions evaluate to? > [] && [] == false true Yes, it is “true”! If you don’t believe me, try it. The question that is addressed in the remainder of this post is: “Really? Why?!” ...