Reading through some code, I came across the use of !0
and !1
. I realize that these are shorter ways of writing true
and false
.
!0 === true
!1 === false
This of course save a few bytes, but is there some other reason to use it?
Is there a name for this way of writing it?
!!0
(false) and!!1
(true) for much more clarity and only a 50% size increase! No. Really, use the keywords .. – Ciri!0
beingtrue
is really easy to misread. – Curler