function maxnum(arr){
var newarr = [];
for(var i = 0; i<arr.length; i++){
if(newarr[arr[i]] == null){
newarr[arr[i]] = 1;
}else{
newarr[arr[i]]++;
}
}
var max = 1;
var resvalue = '';
for(var k in newarr){
if(newarr[k] > max){
resvalue = k;
max = newarr[k];
}
}
return resvalue;
}
```
`
转载于:https://my.oschina.net/u/2897423/blog/1581184