Class Dictionary<K, V>

Dictionary

Dictionary

Type Parameters

  • K
  • V

Hierarchy

  • Map<K, V>
    • Dictionary

Constructors

  • Type Parameters

    • K
    • V

    Parameters

    • Optionalentries: null | readonly (readonly [K, V])[]

    Returns Dictionary<K, V>

  • Type Parameters

    • K
    • V

    Parameters

    • Optionaliterable: null | Iterable<readonly [K, V], any, any>

    Returns Dictionary<K, V>

Properties

[toStringTag]: string
size: number

the number of elements in the Map.

[species]: MapConstructor

Accessors

  • get items(): {
        [key: string]: V;
    }
  • Gets all items

    Returns {
        [key: string]: V;
    }

    • [key: string]: V
  • get Items(): {
        [key: string]: V;
    }
  • Gets the keys and values stored in the Dictionary

    Returns {
        [key: string]: V;
    }

    • [key: string]: V

Methods

  • Returns an iterable of entries in the map.

    Returns MapIterator<[K, V]>

  • Sets the specified value for the given key.

    Parameters

    • key: K
    • value: V

    Returns void

  • Sets the specified value for the given key.

    Parameters

    • key: K
    • value: V

    Returns void

  • Returns void

  • Returns true if the dictionary has the specified key, false if not.

    Parameters

    • key: K

    Returns boolean

  • Returns true if the dictionary contains the given value.

    Parameters

    • value: V

    Returns boolean

  • Parameters

    • key: K

    Returns boolean

    true if an element in the Map existed and has been removed, or false if the element does not exist.

  • Returns an iterable of key, value pairs for every entry in the map.

    Returns MapIterator<[K, V]>

  • Executes a provided function once per each key/value pair in the Map, in insertion order.

    Parameters

    • callbackfn: ((value: V, key: K, map: Map<K, V>) => void)
        • (value, key, map): void
        • Parameters

          • value: V
          • key: K
          • map: Map<K, V>

          Returns void

    • OptionalthisArg: any

    Returns void

  • Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.

    Parameters

    • key: K

    Returns undefined | V

    Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

  • Parameters

    • key: K

    Returns boolean

    boolean indicating whether an element with the specified key exists or not.

  • Returns an iterable of keys in the map

    Returns MapIterator<K>

  • Removes the given key and its value.

    Parameters

    • key: K

    Returns void

  • Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.

    Parameters

    • key: K
    • value: V

    Returns this

  • Adds the given key and value

    Parameters

    • key: K
    • value: V

    Returns boolean

  • Returns a boolean, which, if true, means value has valid information.

    Parameters

    • key: K

    Returns {
        found: boolean;
        value: undefined | V;
    }

    • found: boolean
    • value: undefined | V
  • Returns an iterable of values in the map

    Returns MapIterator<V>