Counts occurrences of tuples.

Constructors

Properties

Methods

Constructors

Properties

accs: {
    [key: string]: accumulator;
} = {}
seenKeys: Set<string> = ...
value: number = 0

Methods

  • Adds the tuple to the accumulator. Each time a tuple is added, the corresponding value increments by 1.

    Alternatively, can also receive an array with the chain of values

    Parameters

    • Rest...args: any[]

    Returns number

    the previous count of the added element

  • Adds the value associated to the given tuple. If no value is defined for the given tuple, returns 0.

    Alternatively, can also receive an array with the chain of values

    Parameters

    • Rest...args: any

    Returns number