Interface WeakMap<K, V>

    interface WeakMap<K, V> {
        [toStringTag]: string;
        delete(key: K): boolean;
        get(key: K): V;
        has(key: K): boolean;
        set(key: K, value: V): this;
    }

    Type Parameters

    Properties

    Methods

    Properties

    [toStringTag]: string

    Methods

    • Removes the specified element from the WeakMap.

      Parameters

      • key: K

      Returns boolean

      true if the element was successfully removed, or false if it was not present.

    • Parameters

      • key: K

      Returns V

      a specified element.

    • Parameters

      • key: K

      Returns boolean

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

    • Adds a new element with a specified key and value.

      Parameters

      • key: K

        Must be an object or symbol.

      • value: V

      Returns this