Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any reason to use !0 instead of true?

Tags:

javascript

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?

like image 232
Paolo Avatar asked Mar 25 '13 14:03

Paolo


1 Answers

If you really care about bandwidth and loading time then you need code compression. !0 and !1 is a compressed version of true and false.

like image 134
Shuping Avatar answered Oct 12 '22 03:10

Shuping