Hacker News new | ask | show | jobs
by darknavi 1622 days ago
I wonder how they picked three as too many. Why not two?

> Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out.

4 comments

Maybe because of the use of the "double bang" pattern to convert a value to boolean:

    !!41 === true
    !!0  === false
`!!thing` is a fairly common JS idiom for "I have a truthy/falsy thing and I want true or false."
Two really does seem too many. I worry about these times when any passing coder can ni-gate at will.
This is the obvious answer.