let arr =
[{num:'2', text: 'aaa', quantity: 1},
{num: '1', text: 'bbb', quantity: 2},
{num: '2', text: 'ccc', quantity: 1},
{num: '2', text: 'ddd', quantity: 1},
{num: '1', text: 'eee', quantity: 1}]
转为
let obj =
{
1:[{answer:'bbb',quantity:2},{answer:'eee',quantity:1}],
2:[{answer:'aaa',quantity:1},{answer:'ccc',quantity:1},{answer:'ddd',quantity:1}]
}
用num作为key