Grouping and summing in Ramda.js
问题 I've got two lists: var listA = [ { Id: 2, Date: "2014-11-28", Amount: 30 }, { Id: 1, Date: "2014-11-27", Amount: 15 }, { Id: 1, Date: "2014-11-28", Amount: 20 }, ]; var listB = [ { Id: 1, Date: "2014-11-27", Amount: 15 }, { Id: 2, Date: "2014-11-26", Amount: 25 }, ]; I want to combine the data from both lists, grouping them by Id and using the highest date for each Id in the result, and summing the totals of the unique objects (ie. objects with the same Id and Date - there can only be one