Hacker News new | ask | show | jobs
by goto11 2208 days ago
It is trivially easy to avoid though, just use === instead of ==.

Most of the JavaScript wtf's are people getting confused by the implicit type conversions (like [] == ![]). If you ask for it, JavaScript will readily convert a string to a number or an object to a boolean. But if you don't like that, just don't rely on implicit conversions.

1 comments

The average developer spends most of her time reading other peoples code, so avoiding having to understand == is a luxury most will not have.