Changes

Jump to: navigation, search

JavaScript Flow Control and Looping

241 bytes added, 19:07, 23 April 2007
The JavaScript ''if'' Structure
<pre>
if (i < 2)
\tdocumentdocument.writeln ("The value of i is less than 2");
</pre>
 
Whilst this is perfectly valid JavaScript it is recommended, for the purposes of consistent scripting style, that the braces be used even for a single line of script after the 'if' statement.
 
=== The JavaScript ''if ... else'' Structure ===

Navigation menu