Last

WMA link


Last[expr]

returns the last element in expr.

Last[expr, def]

returns the last element in expr if it exists or def otherwise.

Last[expr] is equivalent to expr[[-1]].

The first argument need not be a list:

However, the first argument must be Nonatomic when there is a single argument:

Or if it is not, but a second default argument is provided, that is evaluated and returned:

As before, the first argument is empty, but since default argument is given, evaluate and return the second argument:

Insert
Length