I found some code using
!0
!1
I guess this is just the same things than
true
false
is there a reason for doing that or is just some abbreviation?
I found some code using
!0
!1
I guess this is just the same things than
true
false
is there a reason for doing that or is just some abbreviation?
Share
asked
Mar 25, 2013 at 14:39
Paolo
Paolo
2,47266 gold badges3434 silver badges4545 bronze badges
6
-
5
Find who wrote that code and make a note not to hire him or her for any future work. :-)
– Pointy
Commented
Mar 25, 2013 at 14:40
-
1
I would guess it's mainly for obfuscation/uglification.
– Reinstate Monica -- notmaynard
Commented
Mar 25, 2013 at 14:42
-
3
@Pointy This code is produced by JavaScript Closure Compiler, as an example. Is it a time to fire it? ;)
– VisioN
Commented
Mar 25, 2013 at 14:42
-
@VisioN Ha ha! Well then that makes perfect sense I guess.
– Pointy
Commented
Mar 25, 2013 at 14:44
-
In JS it make sense, it can save some loading time. But its definetely ugly :-)
– Gatekeeper
Commented
Mar 25, 2013 at 14:44
|
Show
1 more ment
1 Answer
1
Reset to default
17
If you really care about bandwidth and loading time then you need code pression. !0
and !1
is a pressed version of true
and false
.