export function counter(values: Iterable): Map { const cnts = new Map(); for (const word of values) { cnts.set(word, (cnts.get(word) ?? 0) + 1); } return cnts; }