HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <h2>Syntax</h2>
1 <h2>Syntax</h2>
2 <p>Condition:</p>
2 <p>Condition:</p>
3 if (condition) { action; }<p>Condition with alternative action:</p>
3 if (condition) { action; }<p>Condition with alternative action:</p>
4 if (condition) { actions; } else { other actions; }<p>Nested conditions:</p>
4 if (condition) { actions; } else { other actions; }<p>Nested conditions:</p>
5 if (condition1) { if (condition2) { actions; } }<h2>How Conditions Work</h2>
5 if (condition1) { if (condition2) { actions; } }<h2>How Conditions Work</h2>
6 <p>Expression in parentheses (check) returns true or false. The action inside the condition is executed if true is returned. If the expression returns false, the action will not be executed.</p>
6 <p>Expression in parentheses (check) returns true or false. The action inside the condition is executed if true is returned. If the expression returns false, the action will not be executed.</p>
7 <h2>Code inside the checks</h2>
7 <h2>Code inside the checks</h2>
8 <p>Comparison operators:</p>
8 <p>Comparison operators:</p>
9 OperatorName&gt;more than&lt;less than&gt;=more than or equal to&lt;=less than or equal to<p>Equality operators:</p>
9 OperatorName&gt;more than&lt;less than&gt;=more than or equal to&lt;=less than or equal to<p>Equality operators:</p>
10 OperatorNameDescription==approximate equalitywith casting argument types===strict equalitywithout casting argument types!=“approximate inequality”with casting argument types!==strict inequalitywithout casting argument types<p>Any values within the checks are converted to Boolean datatype. All numbers except 0 are true, with 0 being false. All lines except the empty string are true, empty string '' is false.</p>
10 OperatorNameDescription==approximate equalitywith casting argument types===strict equalitywithout casting argument types!=“approximate inequality”with casting argument types!==strict inequalitywithout casting argument types<p>Any values within the checks are converted to Boolean datatype. All numbers except 0 are true, with 0 being false. All lines except the empty string are true, empty string '' is false.</p>
11 <p>Logical operators.</p>
11 <p>Logical operators.</p>
12 <ul><li>The &amp;&amp; operator or “logical AND” returns true only if both conditions, to the left and right of it, return true.</li>
12 <ul><li>The &amp;&amp; operator or “logical AND” returns true only if both conditions, to the left and right of it, return true.</li>
13 <li>The operator || or “logical OR” returns true if any of the conditions to the left or to the right of it return true.</li>
13 <li>The operator || or “logical OR” returns true if any of the conditions to the left or to the right of it return true.</li>
14 <li>The ! operator or “logical negation” changes the Boolean value of the expression to the right of it to the opposite value.</li>
14 <li>The ! operator or “logical negation” changes the Boolean value of the expression to the right of it to the opposite value.</li>
15 </ul><a>Continue</a>
15 </ul><a>Continue</a>