对于这样的 json 对象,
list=[
 {name:"hello",
  category:"verb"},
 {name:"world",
  category:"noun"}
];
使用下划线对数组进行分类的最快方法是什么:
category=[
{id:"verb",
 list:[
  {name:"hello",
  category:"verb"}
 ]},
{id:"noun",
 list:[
  {name:"world",
  category:"noun"}
 ]}
];
它应该是某种链式 map-reduce ......当然我可以使用_.filter(但这会很慢)或使用for循环轻松地做到这一点。