99% of the time I see usage of Array.prototype.some and Array.prototype.reduce, it would have been much more readable with a manual loop.
-
-
@yungsters and I like the explicitness of === false too. It gives you confidence that the variable is a Boolean. -
I’m okay with unary negation if it’s on a value I know to be boolean. But I see it used to negate too many other things (including null or undefined).
- 1 more reply
New conversation -
-
-
The older I get, the more I dislike unary negation, and its partner in crime, the double-bang idiom for conversion to a boolean. I now lean towards, "Unary negation is only acceptable when applied to something extremely brief, like a single variable or a simple function call."
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
To each their own, but personally, I love the !bang. I find it amazingly useful, consise and easy to know what is doing.
-
I find it just as confusing as when you say "I'm not not going to do that". The equivalent happens when you use !isIgnored. It just messes with my head and I get confused. Not only that but people use it a lot for boolean coercion, like on empty strings which is pretty gross.
- 1 more reply
New conversation -
-
-
HOW VERY DARE YOU!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Dead simple code readability rules, from ancient times, always works, love it.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
You’re a monster
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I also use Boolean() to typecast instead of double bang
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
What about `isWhitelisted` function w/o negation, and then `isIgnored = (relative) => !isWhitelisted(relative)`. For me it’s better than both ! before long statement and `=== false` at the end of long statement.
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 