Logical Operators
Using boolean logic inside if statements.
NOT
Examples
if (someValue !== 0) {
// Do something if the variable is not zero
}
if !(someValue > 10) {
// Do something if the variable is not greater than 10
}
if !(someBoolean) {
// Do something if the variable is false (because the ! makes it true)
}AND
Example
OR
Example
Grouping
Order of Operations
Ternary Operator
Examples
More Info
Last updated