Re:Minify and Gzip (2022)
by djbusby on Monday July 17, 2023 @08:40AM
(#36757502)
So, why use two bytes for '!0' when just '1' works?
[ Parent
| on HN ]
Re:Minify and Gzip (2022)
by tinyhitman on Monday July 17, 2023 @08:44AM
(#36757539)
Its not strictly the same. '1' is a number whereas '!0' is a boolean.
I hate that language a bit more now
Re:Minify and Gzip (2022)
by hn92726819 on Monday July 17, 2023 @08:45AM
(#36757566)
Both 1 and true are truthy, but not the same. That would work if the variable was only ever used in if(x), conditions, etc. Stringifying won't produce the same value either when passing values as well.