count method

int count([
  1. bool test(
    1. MapEntry<K, V> element
    )?
])

Returns the number of entries that matches the test.

If test is not specified it will count every entry.

Example:

[1, 2, 3, 13, 14, 15].count();             // 6
[1, 2, 3, 13, 14, 15].count((n) => n > 9); // 3

Implementation

int count([bool Function(MapEntry<K, V> element)? test]) {
  return entries.count(test);
}