请找出"aaaabbcccdddd"字符串中出现最多的字母

        function getCount(str) {
            for(var code=32;code<128;code++){
                var mych=String.fromCharCode(code);
                var count=0;
                for(var i=0;i<str.length;i++){
                    var ch=str.charAt(i);
                    if(ch===mych){
                        count++;
                    }
                }
                if(count>0){
                    console.log("字符"+mych+"出现了"+count+"次");
                }
            }
        }
原文地址:https://www.cnblogs.com/wuqilang/p/11366989.html