-
JAVASCRIPT > les tests, if, else
L’opérateur !!
C’est un raccourci pour boolean(), qui convertit ce qui suit en une valeur bolléenne.
!!0>false!!null>false!!undefined>false!!48>true!!“hello”>true!![1, 2, 3]>true(
!!) is actually the not (!) operator twice :- The first not operator converts the object to an inverted boolean value.
- The second not operator inverts the inverted boolean value. In other words, this makes it the real boolean value of the object.
True et False
false
false,0,-0,0n(BigInt zero),”,“”,“,null,undefined,NaNTrue
true,[0, 0, 0],"toto",15