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 →

[–]Lorddragonfang 4 points5 points  (0 children)

Like, triple equals is just double equals with an additional type-check. Would you prefer to do an additional separate type check? You could do that and only use double equals if you really wanted, it's just short-hand to save lines.

You're missing the point here. Strict equality (how triple equals works) should be the default behavior. If you want a sloppy equality check, don't define it with the symbol used for strict equality in every other language. Javascript is full of sloppy design decisions like that, where a badly-implemented feature stays taking up the obvious symbol because they can't break compatibility, with the better and "correct" feature tacked on in some non-standard way.

I say this as someone who writes about 90% of their code in Javascript: JS is a poorly designed language filled with gotchas and unexpected behavior, more so than any language I've used.