题解 | #数组求和#
计数
http://www.nowcoder.com/practice/628339bd8e6e440590ad86caa7ac6849
function count(arr, item) {
let itemCount = 0;
for(let i of arr){
if(i === item){
itemCount++;
}
}
return itemCount;
}
计数
http://www.nowcoder.com/practice/628339bd8e6e440590ad86caa7ac6849
function count(arr, item) {
let itemCount = 0;
for(let i of arr){
if(i === item){
itemCount++;
}
}
return itemCount;
}
相关推荐