An extension of ES2015's Map that provides a default value when accessing a key that has not been explicitly set.
npm install @btmills/default-mapAn extension of ES2015's Map that provides a default value when accessing a key that has not been explicitly set.
``ts
import DefaultMap from '@btmills/default-map';
const counter = new DefaultMap
for (const word of input) {
counter.set(word, counter.get(word) + 1);
}
``