sort_by_key
0.0.2 • Public • Published example:
// actions array is sorted by date
var sortByKey = require("sort_by_key");
var bill = { actions:
[ {
action: 'Referred to the committee on Public Safety and Homeland Security',
date: '2013-01-22 00:00:00',
'+chamber': [Object] },
{ date: '2013-01-22 00:00:00',
action: 'House concurred',
actor: 'lower' },
{ date: '2013-09-13 00:00:00',
action: 'Hearing scheduled for 09/13/2013 from 10:00 AM-08:00 PM in Gardner Auditorium',
actor: 'joint' },
{ date: '2014-07-10 00:00:00',
action: 'Senate concurred',
actor: 'upper' } ]
}
var actionsSorted = sortByKey.desc(bill.actions,"date");
console.log(actionsSorted);
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.0.2
0
Version History
Package Sidebar
Install
Weekly Downloads