Starting to use `=== false` more instead of unary `!`. Feels more explicit when JS truthy rules can cause so many unintended bugs.
-
-
You should think of it like this: using explicit `===false` is a hint to humans (i.e. you), but the VM can also utilize the hint for perf.

-
Doesn't `===false` get turned into faster lower level code?
- 1 more reply
New conversation -
-
-
I use them because I want to check for a boolean, not for a empty string or a zero number. It's just how you use a type system.
-
A type system would give you a compile-time error instead of returning false
- 2 more replies
New conversation -
-
-
I'm sure the performance optimization doesn't make a big enough impact to do it over readability
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Premature optimisations that make the code simpler are not the evil ones. Very different to adding caching or using for loops over .map etc
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Makes a lot of sense, particularly if the codebase already enforces ===. Is there an ESLint rule for this?

-
For enforcing triple equals? Or for ensuring you never use a unary operator?
- 3 more replies
New conversation -
-
-
Readable code >>>>>> than any slight performance bump from unary `!`
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 