countList<T> function
Count number of occurrences in an iterable.
Implementation
int countList<T>(Iterable<T> it, T element) {
int count = 0;
for (var v in it) {
if (deepEquals(v, element)) {
count++;
}
}
return count;
}