let foo = true, bar = false;
Results in this compressed code:
So what’s interesting is how the compressor treats literals such as
false into smaller units. You see that
true is represented with
Reading it carefully, we can see that
true has been changed into “not zero”. “zero” is usually an indicator of
false, so in this case, “not zero” means it’s true. And, obviously, it’s the other way around with “not one”.
Now you can update your code and save 2 or 3 bits for every boolean operator :)
If you like this article, go ahead and follow me on Twitter or buy me a coffee to support my work!