var str = ‘abdgcjkssahajdfmmfd‘;
var aObj = {};
var num;
var strMax;
for (var i = 0; i < str.length; i++){
var item = str.charAt(i);
if(aObj[item]){
aObj[item]++;
}else{
aObj[item] = 1;
}
num = 1;
for(var key in aObj){
if(num < aObj[key]){
num = aObj[key];
strMax = key;
}
}
console。log(strMax, num);