function count(str) { str = str.replace(/\s*/g,""); let obj = {}; for(var value of str){ if(obj[value]){ obj[value]++; }else{ obj[value]=1; } } return obj; }
function count(str) { str = str.replace(/\s*/g,""); let obj = {}; for(var value of str){ if(obj[value]){ obj[value]++; }else{ obj[value]=1; } } return obj; }