A bounded map that automatically maintains a maximum number of keys by
removing the oldest entries when new keys are added beyond the limit.
Extends the native Map class to provide all standard map methods while
enforcing a fixed maximum size of MAX_MAP_KEYS (1000 entries).
Tracks insertion order to ensure the oldest keys are removed first when
the limit is exceeded. This provides LRU-like behavior based on insertion
time rather than access time.
Example
constevents = newBMap() events.set('event', 1) // Automatically removes oldest if over 1000
A bounded map that automatically maintains a maximum number of keys by removing the oldest entries when new keys are added beyond the limit.
Extends the native Map class to provide all standard map methods while enforcing a fixed maximum size of MAX_MAP_KEYS (1000 entries).
Tracks insertion order to ensure the oldest keys are removed first when the limit is exceeded. This provides LRU-like behavior based on insertion time rather than access time.
Example