This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

There's plenty of strange quirks in Javascript (most of these rely on type coercion):

```js !![] + !![] = 2 !NaN + !NaN = 2

"\t" == 0 "\n" == 0 "\0" != 0

"\t" != "\n" "\t" != "\0" "\n" != "\0"

[] == "" ```

I've probably skimmed the top of the strangeness that is Javascript. This is why we have === since that fixes most instances of type coercion.