let arr = [1, 3, 5, 7, 7, 7, 9, 9]
Array.prototype.zuiduo = function () {
let num;
let cishu = 1;
arr.reduce((p, k) => {
p[k] ? p[k]++ : p[k] = 1
if (p[k] > cishu) {
num = k;
cishu++;
}
return p
}, {})
return num + "次数" + cishu
}
console.log(arr.zuiduo());