0
document.write((4 < 2)!(10 >15));
above code is returning uncaught syntax error , why this, I am trying to check boolean operator not
6 Antworten
+ 6
The boolean operator not take only one argument... you try to use it with two ^^
!false is true
!true is false
... but your (4<2)!(10>5) stand for false!true, and javascript interpreter don't know how to handle it: and you? :P
+ 3
Not just like '&&':
'and' ( '&&' ) is a binary boolean operator, while 'not' ( '!' ) is a unary boolean operator...
Meanning you can write ( a && b ), but you cannot ( a ! b), just ( !a ) and/or ( !b ).
Try to say it as human language: if a and b... sound logical, but: if a not b don't ( while: if not a, and/or: if not b are )
0
and what ! is supposed to mean?
0
maybe you want to use " != ", try with (4<2)!=(10>15)
0
! mean not a logical operator
0
"!" is a " boolean logical operator just like "&&"