题解 | #字符串字符统计#
字符串字符统计
https://www.nowcoder.com/practice/777d0cd160de485cae0b1fd1dd973b44
function count(str) {
let obj = {};
let arr = [...str];
arr.map(n => {
if (n != false && obj[n] != undefined) {
obj[n]++;
} else {
obj[n] = 1;
}
})
return obj;
}
科大讯飞公司氛围 455人发布