Decisions and Loops
Evaluating condition
You can evaluate a situation by comparing one value in the script to what ypu expect it might be. The resuklt will be a Boolean: true or false.
Examples
== (Is Equal to)
!= (Is not Equal to)
=== (Strict Equal to)
!== (Strict not Equal to)
> (Greater than)
< (Less than)
>-= (Greater than or Equal to)
<= (Less than or Equal to)
Logical operators
Comparison operators usually return single values of true or false. Logical operators allow you to compare the results of more than one comparison operator.
Examples:
&& (Logical and): This operator tests more than one condition.
II ( logical or): This operator tests at least one condition.
! (Logical not): this operator takes a single Boolean value and inverts it.
If statements
The if statement evaluates (or checks) a condation. If the condation evaluates to true, any statement in the subsequent code block are executed.
##If…Else statement