标签:最大 return java rip var code style javascrip get
javascript实现
function getMaxCharNum(str) { var arr = str.split(‘‘),hash = {},max = 0,maxItem; arr.forEach(function(item){ if(hash[item]){ hash[item]++; } else{ hash[item]=1; } if(max < hash[item]){ max = hash[item]; maxItem = item; } }); return { count:max, item:maxItem, hash:hash } }
标签:最大 return java rip var code style javascrip get
原文地址:http://www.cnblogs.com/mengff/p/6202290.html