Actually, this small change fixes it:
toCode:if(arr[j] == str) { arr.splice(j,1); count++; }
Thank you marlopax!Code:while(arr[j] == str) { arr.splice(j,1); count++; }
|
Results 1 to 10 of 10
Thread: Count duplicate array entries?Threaded View
|
Click Here to Expand Forum to Full Width |