Product Site

5.3.6.27. previous

Returns the index of the item that precedes the array item having index index or .nil if the item having that index is first in the array. For multi-dimensional Arrays, the same ordering used by the allItems method is used to determine the previous position and the index is returned as an array of index values.

Note that the index argument may also be specified as an array of indexes.
Example 5.185. Array class — previous method
a = .array~of("Fred", , "Mike", , "David")
say a~previous(3)  -- says: 1