Dictionary - an iterable data store

Instantiate with a template type for the key:

const store: Dictionary<string> = new Dictionary<string>();

Type Parameters

  • K

  • T

Hierarchy

Implements

Constructors

Properties

items: {
    [index: string]: any;
} = {}

Type declaration

  • [index: string]: any

Methods

  • Check if an item exists - by value

    Parameters

    • value: any

      The item required

    Returns boolean

  • Check if a key exists

    Parameters

    • key: string

      The key required

    Returns boolean

  • Get an item by key

    Parameters

    • key: string

      The element key

    Returns any

  • Put a new key/value pair Overwrites an existing key

    Parameters

    • key: string

      The key

    • value: any

      The value - supports null

    Returns any

  • Remove an item by key

    Parameters

    • key: string

      The key to remove

    Returns any