If

WMA link


If[cond, pos, neg]

returns pos if cond evaluates to True, and neg if it evaluates to
False.

If[cond, pos, neg, other]

returns other if cond evaluates to neither True nor False.

If[cond, pos]

returns Null if cond evaluates to False.

If the second branch is not specified, Null is taken:

You might use comments inside (* and *) to make the branches of If
more readable:

Since one or more arguments to a boolean operation could be symbolic, it is possible that an If cannot be evaluated. For example:

To handle this, If takes an optional fourth parameter:

For
Interrupt