keysort

Sorts an Array of Objects based on key values, like an SQL `ORDER BY`

View the Project on GitHub avoidwork/keysort

Example

var arr = [{abc: 123124, xyz: 5}, {abc: 123124, xyz: 6}, {abc: 2, xyz: 5}];

keysort(arr, "abc"); // [{abc: 2, xyz: 5}, {abc: 123124, xyz: 5}, {abc: 123124, xyz: 6}];
keysort(arr, "abc, xyz desc"); // [{abc: 2, xyz: 5}, {abc: 123124, xyz: 6}, {abc: 123124, xyz: 5}];

What is Supported?

License

Copyright (c) 2013 Jason Mulligan
Licensed under the BSD-3 license.