The logical NOT operator is indicated by an exclamation point (!).
The logical NOT always returns a Boolean value.
The logical NOT operator behaves in the following way:
<html> <script language="JavaScript"> <!-- theTruth = new String("1"); theReverseTruth = !theTruth; document.write("theTruth = ",theTruth,"<br>"); document.write("theReverseTruth = ",theReverseTruth); --> </script> </html>
2.6.Boolean Operators | ||||
2.6.1. | JavaScript provides three Boolean operators | |||
2.6.2. | Logical AND | |||
2.6.3. | ! (Logical NOT) | |||
2.6.4. | Use logical NOT to control the loop | |||
2.6.5. | || (Logical OR) |