Last
Last[expr] gives the last element in expr.
Last[expr, def] gives the last element if there are any elements, or def otherwise.
Examples
Get the last element:
Last[{a, b, c}]
(* c *)With a default value:
Last[{}, "empty"]
(* "empty" *)Please visit the official Wolfram Language Reference for more details.