Underscore.js groupBy multiple values

前端 未结 9 1491
渐次进展
渐次进展 2020-12-01 05:03

Using Underscore.js, I\'m trying to group a list of items multiple times, ie

Group by SIZE then for each SIZE, group by CATEGORY...

http://jsfiddle.net/ricky

9条回答
  •  长情又很酷
    2020-12-01 05:09

    Check out this underscore extension: Underscore.Nest, by Irene Ros.

    This extension's output will be slightly different from what you specify, but the module is only about 100 lines of code, so you should be able to scan to get direction.

提交回复
热议问题