for of 迭代可迭代对象

function count(str) {
    const m = {}
    for(let k of str){
        if(k === ' ') continue
        if(k in m){
            m[k]++
        } else {
            m[k] = 1
        }
    }
    return m
}