SOURCE

const str = 'aaaabbbbccccdddeeb'
const obj = {}
for(let i = 0; i< str.length; i++) {
    const char  = str[i]
    if (obj[char]) {
        obj[char]++
    } else {
        obj[char] = 1
    }
}
// console.log('obj', JSON.stringify(obj))

let max = 0
for(let key in obj) {
    if (max < obj[key]) max = obj[key]
}
console.log('max', max)
console 命令行工具 X clear

                    
>
console