as shown in the array below, you want to get [{name: "zhang", conut: 4}, {name:" wang", conut: 2}, {name: "liu", conut: 2}]
, or [{zhang: 4}, {wang: 2}, {liu: 2}]
Thank you
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"},
]