如下面的数组, 希望得到[{name: 'zhang', conut: 4},{name: 'wang', conut: 2},{name: 'liu', conut: 2}]
,或者[{zhang: 4},{wang: 2},{liu: 2}]
谢谢了
let arr= [
{name: 'zhang', age: '20'},
{name: 'wang', age: '22'},
{name: 'zhang', age: '20'},
{name: 'liu', age: '23'},
{name: 'liu', age: '23'},
{name: 'wang', age: '22'},
{name: 'zhang', age: '20'},
{name: 'zhang', age: '20'},
]