IF Conditionals

The script that produces the output is easy to understand.
Try to understand the script source code and then read below for further explanation.

An IF Statement is the most fundamental Conditional Statement.
   
    if ( boolean expression )   {
      
      JavaScript Statements
      
    }
    
If the Boolean expression evaluates to true, then the statements in the body {} of the IF statement are executed.
If the Boolean expression evaluates to false, then the statements in the body {} are completely skipped.

This is called a conditional because the statements in its body are only executed upon a certain condition being true.
In this way, you can have lots of code in a script that is never executed unless a certain condition is met.