Operator Type:
Operator Scope of Action:
Operator Purpose:
Data Type Returned:
Operator First Added:
Operator in Current Baseline:
Operator Last Altered:
Function [other Function type actions]
Item [operators of similar scope]
Data manipulation [other Data manipulation operators]
List [about List data type]
v5.8.0
Baseline
As at baseline
Syntax note: Operators without any defined mandatory arguments may omit their empty closing parentheses
list.reverse()
list.reverse
This function reverses the order of the referenced List-type list. The function does not reverse the individual list values, but rather reverses the exact order of the individual values. Trailing parentheses are optional for this function.
$MyList = $MyList.reverse();
$MyList = [ant;bee;cow].reverse();
The function may be chained with the list.sort() and list.isort() functions, noting that sorting can only be used with List-type and not Set-type data:
$MyList = $MyList.sort().reverse();
$MyList = $MyList.isort().reverse();
Reversing Set-type lists
As set-type lists are auto-sorted, this operator only makes sense to use when passing to that function/operator/type other that set data.
See also—notes linking to here: