I have to admit that I would never bother to use === for something like this:
Code:
if(tileTopCount===map[x].length){
I mean, we *KNOW* that both of those values are numbers. The one because we made it so, the other because the
.length property is guaranteed to be so.
So why do we need to test that the types are equal?
If JavaScript were more sensitive to what === means, I might be more inclined to use it. For example, if === distinguished between integers and non-integers. But it doesn't, because JavaScript doesn't see a distinction between them.
I commonly only use === when I'm comparing against something being returned by some function and where I can't guarantee the type being returned.
Still, it's a nice operator to have in your arsenal.