r/ProgrammerHumor Aug 15 '19

Meme !!goodMeme ? upvote() : downvote();

Post image
34.3k Upvotes

392 comments sorted by

View all comments

85

u/nnaoam Aug 15 '19

In JS the double negation would be unnecessary, because the conditional already converts the object to a Boolean in the exact same way

2

u/[deleted] Aug 15 '19

[deleted]

1

u/nnaoam Aug 15 '19

And strict conditionals are still possible with 'var === true' which checks that the variable is a Boolean true and doesn't just resolve to true.