If
[cond, pos, neg]True
, and neg if it evaluates toFalse
.If
[cond, pos, neg, other]True
nor False
.If
[cond, pos]Null
if cond evaluates to False
.If[1<2, a, b]
If the second branch is not specified, Null
is taken:
If[1<2, a]
If[False, a] //FullForm
You might use comments (inside (*
and *)
) to make the branches of If
more readable:
If[a, (*then*) b, (*else*) c];