Represents a collection of keys and values.

Type Parameters

  • TKey
  • TValue

Hierarchy (view full)

Implements

Constructors

Properties

Gets or sets the value associated with the specified key.

The key of the value to get or set.

The value associated with the specified key. If the specified key is not found, a get operation throws a System.Collections.Generic.KeyNotFoundException, and a set operation creates a new element with the specified key.

Accessors

Methods

  • Adds the specified key and value to the dictionary.

    Parameters

    • key: TKey | JsType<TKey>

      The key of the element to add.

    • value: TValue | JsType<TValue>

      The value of the element to add. The value can be null for reference types.

    Returns void

  • Casts this object to the specified type. Throws error on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns T1

  • Determines whether the specified object is equal to the current object.

    Parameters

    • obj: any

      The object to compare with the current object.

    Returns boolean

    true if the specified object is equal to the current object; otherwise, false.

  • Serves as the default hash function.

    Returns number

    A hash code for the current object.

  • Returns a string that represents the current object.

    Returns string

    A string that represents the current object.

  • Casts this object to the specified type. Returns null on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns null | T1

  • Determines whether the specified object instances are considered equal.

    Parameters

    • objA: any

      The first object to compare.

    • objB: any

      The second object to compare.

    Returns boolean

    true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.