underscore.js - Limit underscorejs group by length -
i have long list of articles grouped category, how can limit each category have 4 (or other number) items?
my input is:
and want 4 articles on each section
map object values sliced versions of themselves:
_.mapobject(groupedarticles, function(group) { return group.slice(0, 4); })
Comments
Post a Comment