JavaScript: Always Use Triple-equals When Checking Equality

Sam Rueby Uncategorized 0 Comments

I wanted to reblog this because I didn’t realize until recently how important this is and I keep running into it. A Tweet from @dNetGuru ( Farzad E. ) shows an excellent chart of why this is important and not just nit-picking.

Do you really want [1] to equal “1” and true? Do you really want [[]] to equal “”? Avoid weird bugs by using ===.