WLJS LogoWLJS Notebook

First

First[expr] gives the first element in expr.

First[expr, def] gives the first element if it exists, or def otherwise.

Examples

Get the first element:

First[{a, b, c}]
(* a *)

With a default value:

First[{}, "empty"]
(* "empty" *)

Please visit the official Wolfram Language Reference for more details.

On this page