function findNum(a){
var result = [0,0];
for (var i = 0; i < a.length; i++) {
for (var j = 0,count = 0; j < a.length; j++) {
if (a[i]==a[j]) {
++count;
};
};
if(count>result[0]) {
result[0] = count;
result[1] = a[i];
}else if(count==result[0]&&result[1]<a[i]) {
result[1] = a[i];
}
}
alert("数"+result[1]+"重复了最多次,为"+result[0]);
}
var arr = [2,2,3,3,3,4,4,4,4,4,4,4,4,43,3];
findNum(arr);