|Top Previous Next|
Executes statements conditionally. It allows more than one flow of control.
expression is evaluated and if it is true, statement1 is executed, otherwise, statement2 is executed. If the optional else cause is missing, expression is evaluated and if the resulting value is true, statement is executed. If expression is false, statement is not executed.
When working with nested if statements, note that an else clause is part of the nearest if statement.
if (temperature >= 90)
var alert = 'ON';
Net.write(alert); // Returns ON