Translations:Extension:Scribunto/Lua reference manual/1753/en

Sorts table elements in a given order, in-place, from  to. If  is given, then it must be a function that receives two table elements, and returns true when the first is less than the second (so that   will be true after the sort). If  is not given, then the standard Lua operator   is used instead. Note that a consequence of this is that all elements of a table must be comparable, or else the function will throw an error.