Table.prototype.sortedBy

Returns a new table with the rows sorted by the specified column.

Syntax

sortedBy(column, sortFn)

Parameters

Example

new Table(["Item", "Count"], [
  ["Bicycle", 5],
  ["Scooter", 2]
]).sortedBy("Count")
ItemCount
Scooter2
Bicycle5