Booleans in Solidity
bool: The possible values are constants - true and false.
Boolean Operators:
! (Logical negation)
&& (logical conjunction, “and”)
|| (logical disjunction, “or”)
\== (equality)
! = (inequality)
The operators || and && apply the common short-circuiting rules. This means that in the expression f(x) || g(y), if f(x) evaluates to true, g(y) will not be evaluated even if it may have side effects.
Examples:
|
Boolean values can be modified within contracts and can be used in both incoming and outgoing parameters and the return value, as shown in the following example:
|
For more content, follow me on - https://linktr.ee/shlokkumar2303