我有这个对象数组:
const employees = [
{age: 35, name: "David" position: "Front-End"},
{age: 24, name: "Patrick" position: "Back-End"},
{age: 22, name: "Jonathan" position: "Front-End"},
{age: 32, name: "Raphael" position: "Full-Stack"},
{age: 44, name: "Cole" position: "Back-End"},
{age: 28, name: "Michael" position: "Front-End"},
]
我想得到这样的结果:
const employees = [
{position: "Front-End", count: 3},
{position: "Back-End", count: 2},
{position: "Full-Stack", count: 1},
]
这与该结果或最相似的结果有何关系?
繁星淼淼
相关分类