If-Else

If/else statements are one of the most fundamental tools in writing scripts. These statements check to see if a statement is true, if it is true it will perform a set of actions. If it is not true it will skip those actions and continue to the next statement until a statement is true or it runs out of statements to check.

Example 1 - Always true

Example 2 - Always false

Example 3 - Sometimes true

Example 4 - If, else-if

Example 3 - If, else-if, else

 

Peacock