JavaScript compares things weirdly
We’ve already established that PHP compares things weirdly.
It shouldn’t surprise us that JavaScript does too.
Consider the following:
> var k=['hello'];
undefined
> (k=='hello'?'Equals':'Nope');
Equals
Now, purists will point out that that’s an “equals” operator not an “identity” operator, but I mean seriously? We’re just going to pretend that
> ['hello']=='hello'
true
I think I’ll just go and rewrite all my client side code in C now.