🌈 搜索
📅  最后修改于: 2022-03-11 15:04:00.433000             🧑  作者: Mango
const counts = {}; your_array.forEach(function(x.name) { counts[x.name] = (counts[x.name] || 0)+1; });