The workaround in the article was:
var thingsGroupedById = _.groupBy(things, function(t){
return 'seller' + t.sellerId
});
// { seller1: [...], seller2: [...] }
But I actually would have failed this in code review: _.map(thingsGroupedById, function (things) {
// ...
});
and replaced it with: _.map(_.keys(thingsGroupedById), function (thingKey) {
var thing = thingsGroupedById[thingKey];
// ...
});
because although mapping over objects is "normal", it has never been 100%.