SOURCE

let arr = [3, 3, 5, 32, 77, 8]
// for (let i = 0; i < arr.length - 1; i++) {
//     for (let j = 0; j < arr.length - 1 - i; j++) {
//         if (arr[j] < arr[j + 1]) {
//             let temp = arr[j + 1]
//             arr[j + 1] = arr[j]
//             arr[j] = temp
//         }

//     }
// }
//[77,32,8,5,3,3]
console.log(arr)
let has = {}
for (let i = 0; i < arr.length - 1; i++) {
        console.log('-111-arr', arr[i])
    has[arr[i]] = 0
}
// console.log('-111-arr',arr)
// console.log('--111-has',has)
for (let i = 0; i < arr.length - 1; i++) {
    console.log('-222-arr', arr[i])
    for (let key in has) {
        if (arr[i] === parseInt(key)) {
            // console.log('--333-arr[i]', arr[i])
            has[key] = has[key] + 1
        }
    }
}
console.log('---has', has)
// let add = {
//     "1": 'sss'
// }
// console.log(add)
console 命令行工具 X clear

                    
>
console