function arrDis(arr,current){
var count = 0;
for(var i=0;i<arr.length;i++){
if(arr[i] == current){
count++;
}
}
return count;
}
window.onload = function(){
var times = arrDis(['w','n','w','n','c','s'],'w');
console.log(times);
}