Garry's Mod Wiki


  function, table SortedPairsByValue( table table, boolean descending = false )


Returns an iterator function that can be used to loop through a table in order of its values.

To sort by specific value member, use SortedPairsByMemberValue.

To sort by keys, use SortedPairs.


1 table table
Table to create iterator for
2 boolean descending = false
Whether the iterator should iterate in descending order or not


1 function
Iterator function
2 table
The table which will be iterated over