Compare Revisions

Statements (Control Flow)

Revision 429707:

Revision 429707 by iskitz on

Revision 429731:

Revision 429731 by iskitz on

Title:
Statements (Control Flow)
Statements (Control Flow)
Slug:
Web/JavaScript/Guide/Statements
Web/JavaScript/Guide/Statements
Tags:
"control statements","statements","JavaScript"
"control statements","statements","JavaScript"
Content:

Revision 429707
Revision 429731
n83      <code>condition</code> can be any expression that evaluatesn83      <code>condition</code> can be any expression that evaluates
> to true or false. If <code>condition</code> evaluates to true, <> to true or false. See <a href="/en-US/docs/Web/JavaScript/Refere
>code>statement_1</code> is executed; otherwise, <code>statement_2>nce/Global_Objects/Boolean#Description" title="/en-US/docs/Web/Ja
></code> is executed. <code>statement_1</code> and <code>statement>vaScript/Reference/Global_Objects/Boolean#Description">Boolean</a
>_2</code> can be any statement, including further nested <code>if>> for an explanation of what evaluates to <code>true</code> and <
></code> statements.>code>false</code>. If <code>condition</code> evaluates to true, <
 >code>statement_1</code> is executed; otherwise, <code>statement_2
 ></code> is executed. <code>statement_1</code> and <code>statement
 >_2</code> can be any statement, including further nested <code>if
 ></code> statements.
n104  statement_1_runs_if_condition_is_truen104    statement_1_runs_if_condition_is_true
105  statement_2_runs_if_condition_is_true105    statement_2_runs_if_condition_is_true
t107</pre>t
108    <div>
109      &nbsp; statement_3_runs_if_condition_is_not_true107    statement_3_runs_if_condition_is_false
110    </div>
111    <div>
112      &nbsp; statement_4_runs_if_condition_is_not_true108    statement_4_runs_if_condition_is_false
113    </div>109}
114    <div>110</pre>
115      }
116    </div>

Back to History