Negation converts a non-boolean, but truthy value to a pure boolean.
I ran this in Chrome Developer Tools:
> !1
false
> !0
true
Therefore, !1
is interchangeable with false
and !0
is interchangeable with true
. So now that we know it's safe to change it, the next question is why. Well, because it's fewer bytes. The point of minification is to make the code smaller, but compatible.
Long-story short, it's a safe way to compress the literal true
and false
so they take less space when transmitting over the wire.