- && (AND)
- || (OR)
- ! (NOT)
For something to be true, both the values would have to be true.
For example, requesting if:
true && true = true
true && false = false
false && false = false
|| (OR) is requesting if one of the values is true. For example:
true || fsadf = true
false || true = true
false || false = false
! (NOT) is a negation, so requesting if:
!true = false (something not true is false)
!false = true (something not false is true)
You can also combine logical operators. For example:
!(true && true) = false (because true AND true is true, and negating it is false)
For more on operators, go to https://jamesymcjamesface.blogspot.com/2020/04/javascript-operators.html
No comments:
Post a Comment