last2 ( seq -- penultimate ultimate )
Factor handbook » The language » Collections » Sequence operations » Accessing sequence elements

Prev:first4 ( seq -- first second third fourth )


Vocabulary
sequences

Inputs
seqa sequence


Outputs
penultimatean object
ultimatean object


Word description
Outputs the last two elements of a sequence.

Errors
Throws an error if the sequence has fewer than two elements.

See also
first, first2, last, but-last, but-last-slice, rest, rest-slice

Definition