Function ofCircularMutable

Returns a IMapOfMutableExtended that uses a ICircularArray to hold values. Mutable. This means that the number of values stored under each key will be limited to the defined capacity.

Required option:

  • capacity: how many items to hold
const map = ofCircularMutable({capacity: 3});
map.add(`hello`, [1, 2, 3, 4, 5]);
const hello = map.get(`hello`); // [3, 4, 5]