统计字符串中字符出现的次数
var a = {}; var str = 'gouod'.split(""); str.forEach(function (v, i) { a[v] = a[v] == undefined ? 1 : a[v] + 1; }) console.info(a)
var a = {}; var str = 'gouod'.split(""); str.forEach(function (v, i) { a[v] = a[v] == undefined ? 1 : a[v] + 1; }) console.info(a)