Java: Java Programming For Beginners a simple Start To Java Programming (Written By a software Engineer)


Download 0.82 Mb.
Pdf ko'rish
bet85/95
Sana09.01.2022
Hajmi0.82 Mb.
#261112
1   ...   81   82   83   84   85   86   87   88   ...   95
Bog'liq
Java Programming For Beginners - A Simple Start to Java Programming ( PDFDrive )

Logical Operators
Three logical operators are available for use in JavaScript namely, Not (!), Or (||) and And
(&&).  The  results  of  operations  that  involve  these  operators  are  Boolean  (true  or  false).
The results of these operations are computed in accordance with the following:
AND (&&) Binary operator
Both the conditions must be true
OR (||)
Binary operator
At least one of the conditions must be true
NOT (!)
Unary operator
The value of the condition determined is complemented.
For example,
‘Red’ != ‘Blue’ && 5 > 1 = ‘true’
‘Red’ != ‘Blue’ && 5 < 1 = ‘false’
‘Red’ == ‘Blue’ && 5 < 1 = ‘false’
For  conditional  operators,  JavaScript  uses  short-circuit  evaluation.  In  other  words,  if  the
value  of  the  first  condition  is  computed  to  be  ‘false’,  the  system  does  not  evaluate  the
other condition and directly presents the result.

Download 0.82 Mb.

Do'stlaringiz bilan baham:
1   ...   81   82   83   84   85   86   87   88   ...   95




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling