rfw2d
    Preparing search index...

    Class ArrayMap<K, V>

    Array-backed map. Trades memory for iteration speed

    Type Parameters

    • K
    • V
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    keys: readonly K[]

    Read-only array of keys in the map.

    values: readonly V[]

    Read-only array of values in the map.

    Accessors

    Methods

    • Get value at index.

      Parameters

      • index: number

        Index into backing array

      Returns undefined | V

      Value or undefined

    • Delete entry for key k.

      Parameters

      • k: K

        Key

      Returns boolean

      true if an entry was removed

    • Get value for key k.

      Parameters

      • k: K

        Key

      Returns undefined | V

      Value or undefined

    • Check if a key exists in the map.

      Parameters

      • k: K

        Key

      Returns boolean

      true if key exists

    • Get key at index.

      Parameters

      • index: number

        Index into backing array

      Returns undefined | K

      Key or undefined

    • Set value v for key k. Overrides existing values for k.

      Parameters

      • k: K

        Key

      • v: V

        Value

      Returns this

      Self