Changes

JavaScript Flow Control and Looping

No change in size, 19:17, 23 April 2007
Conditional Statements
Conditional statements control whether a part of a script is executed depending the result of a particular expression (i.e whether an expression returns a boolean ''true'' or ''false'' value). The two types of conditional structures are ''if'' and ''if ... else''. In this section we will take a closer look at both of these condtional structures and provide some examples of their use.
=== The JavaScript ''if'' Structure Statement ===
The first line of an 'if'' structure involves the ''if'' statement followed by the expression to be evaluated in parentheses. For example: