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)