🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
OCLOperators last

last () : T

Returns the last element in the list operated on. The operand will be converted to a list prior to evaluating the operation.

Expression Result
OrderedSet{1, 2.0, '3'}->last() '3'

Example

Given a Class of Fruit

Fruit.allinstances->last

This returns the last element.