Class MapWithDefault<K, V>

Type Parameters

  • K

  • V

Hierarchy

  • Map<K, V>
    • MapWithDefault

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • K

    • V

    Parameters

    • createDefault: (() => V)
        • (): V
        • Returns V

    Returns MapWithDefault<K, V>

Properties

createDefault: (() => V)

Type declaration

    • (): V
    • Returns V

Methods

  • Returns the value if the key already exists. If not, it creates a new value under that key using the ctor callback and returns it.

    Parameters

    • key: K

    Returns V

Generated using TypeDoc