Such as if(!!you) , I thought we can get rid of the !! , and it's the same. Cause JavaScript will change it to Boolean automatically?
Asked
Active
Viewed 55 times
-2
-
duplicate http://stackoverflow.com/questions/784929/what-is-the-not-not-operator-in-javascript http://stackoverflow.com/questions/9284664/double-exclamation-points – hallie Jul 15 '15 at 01:15
1 Answers
0
!!
cast the variable to a Boolean. Similar to how you do +foo
to cast it to a number.

Derek 朕會功夫
- 92,235
- 44
- 185
- 247