g.js — graphical objects for JavaScript

sortsort

Sort the items in the list.

g.sort([8, 4, 2, 1]);

If you have a table (e.g. from import.html) you can give an additional key to sort by:

var table = g.import('people.csv');
g.sort(table, 'age');

Parameters

  • l: The input list.
  • key: The sorting key (optional).

See Also