6

Is there any difference between !!! and !?

Found at jasmine source code in the toBeFalsy matcher.

Results from chrome devtools

!!!undefined
true
!undefined
true
!!!null
true
!null
true
!!!0
true
!0
true
boop
  • 7,413
  • 13
  • 50
  • 94
  • 7
    I'm not going to say that there is not no difference. –  Jun 17 '15 at 15:25
  • 1
    Maybe it was `!!` initially (convert anything to boolean), then the condition had to be inverted and the maintainer added another `!` operator without thinking. That, or they play [BlazBlue](http://blazblue.wikia.com/wiki/Bang_Shishigami) *way* too much. – Frédéric Hamidi Jun 17 '15 at 15:25
  • There is no difference between ! and !!! – Drakes Jun 17 '15 at 15:26

1 Answers1

12

Is there any difference between !!! and !?

No. They are the same.

Why should I use !!! instead of ! (3 instead of 1 bang)

To annoy programmers

Drakes
  • 23,254
  • 3
  • 51
  • 94