📌  相关文章
📜  js中一个元素重复数组的次数 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:30.748000             🧑  作者: Mango

代码示例1
uniqueCount = ["a","b","c","d","d","e","a","b","c","f","g","h","h","h","e","a"];
var count = {};
uniqueCount.forEach(function(i) { count[i] = (count[i]||0) + 1;});
console.log(count);
 Run code snippet