给定一个字符串,统计每个字符出现的次数
let string = "cdufebfwinamncaodenivbiyrwvnf"
function getLatterCount(string){
const result = {}
for (const key of string) {
if(!result[key]){
result[key] = 1
}else{
result[key]++
}
}
return result
}
console.log(getLatterCount(string))