Type of items
Add one or more values, firing change event.
Values to add. Fires change event after adding item(s)
Adds event listener.
Events
Event name
Event handler
Clear data. Fires change
event
Calculate min,max,avg,total & count from values
Returns {min,max,avg,total}
Returns a string with keys and counts, useful for debugging.
Return entries sorted
Sorting style (default: value, ie. count)
Sorted array of [key,frequency]
Protected
fireFire event
Type of event
Arguments for event
Value to count
Frequency of value, or undefined if it does not exist
Iterator over keys (ie. groups)
Value to count
Relative frequency of value
, or undefined if it does not exist
Remove event listener
Copy of entries as an array of [key, count]
Iterator over frequency counts
Frequency keeps track of how many times a particular value is seen, but unlike a Map it does not store the data. By default compares items by value (via JSON.stringify).
Fires
change
event when items are added or it is cleared.Overview
Usage
Custom key string