Class Sequence<V, K>Abstract

A sequence is an iterable Collection type with efficient index-based access.

Abstract

Type Parameters

  • V = any

  • K = any

Hierarchy

Constructors

Accessors

  • get size(): number
  • Returns the total number of elements in the collection.

    Returns number

Methods

  • Adds a new item to the collection.

    Parameters

    • item: any

      The item to add to the collection.

    Returns any

  • Adds a new item to the end of the sequence. Alias of add.

    Memberof

    Sequence

    Parameters

    • x: V | Iterable<V>

    Returns any

  • Checks if item is present in the collection.

    Returns

    true when the element is found, else false

    Parameters

    • item: any

      The item to search for in the collection.

    Returns boolean

  • Returns an iterator of all the [key, value] pairs in order.

    Returns Iterable<[K, V]>

  • Return the item at the given key or index

    Memberof

    Sequence

    Parameters

    • key: K

    Returns any

  • Remove a given value from the collection if exists.

    Returns

    the value that was removed or undefined.

    Parameters

    • x: V

    Returns any

  • Set a new value at the given key or index

    Memberof

    Sequence

    Parameters

    • key: K
    • value: V

    Returns any

Generated using TypeDoc