• Counts the occurrences of a value in an array

    Example

    count([1, 1, 2, 1, 2, 3]); // 6
    

    Example

    count([1, 1, 2, 1, 2, 3], 1); // 3
    

    Type Parameters

    • Value

    Parameters

    • array: Value[]
    • Optional value: Value

    Returns number

Generated using TypeDoc