Relying on JS illogical behaviour:
[] === [] // false
It's more confusing and error prone than other options mentioned in the article. [] === [] // false
It's more confusing and error prone than other options mentioned in the article.There's nothing whatsoever illogical about two mutable objects that are not identical being reported as unequal, and it's hard to think of any language that has mutable values at all where there isn't an equivalent feature.
new String[1] == new String[1]
in Java, which would also be false.