题解 | #计数#
计数
http://www.nowcoder.com/practice/628339bd8e6e440590ad86caa7ac6849
function count(arr, item) {
var count = 0;
for(var i=0;i<arr.length;i++){
if(arr[i]==item){
count++
}
}
return count;
}
计数
http://www.nowcoder.com/practice/628339bd8e6e440590ad86caa7ac6849
function count(arr, item) {
var count = 0;
for(var i=0;i<arr.length;i++){
if(arr[i]==item){
count++
}
}
return count;
}
相关推荐