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.
-
Show this thread
-
This is the example that prompted the tweet. #1 is way more readable to me, do others agree? All the usage I've seen has been similar in readability to this.pic.twitter.com/OVEfJCHQyI
57 replies 4 retweets 97 likesShow this thread -
Since everyone seems to have a lot of free time to argue with me on the 4th of July. I also heavily dislike the use of unary ! for boolean negation. eg. !true. I've started writing `=== false`.
10 replies 4 retweets 81 likesShow this thread -
Replying to @sebmck
@yungsters and I like the explicitness of === false too. It gives you confidence that the variable is a Boolean.1 reply 0 retweets 3 likes -
Replying to @Eli_White @sebmck
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 reply 0 retweets 2 likes
Yeah I'm okay with this usage too. Another rule that I use is that I only use it on bare variables like `!isFoo` while more complex expressions I use `isFo() === false`.
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 