Interface ISequence<T>

generalized version of Array function similar to Scala ISeq

interface ISequence<T> {
    length: number;
    every(callback): boolean;
    filter(callback): ISequence<T>;
    forEach(callback): void;
    map<U>(callback): ISequence<U>;
    reduce<U>(callback, initial): U;
    some(callback): boolean;
}

Type Parameters

  • T

Hierarchy (view full)

Properties

length: number

Methods

  • Parameters

    • callback: ((v, i) => boolean)
        • (v, i): boolean
        • Parameters

          • v: T
          • i: number

          Returns boolean

    Returns boolean

  • Type Parameters

    • U

    Parameters

    • callback: ((acc, v, i) => U)
        • (acc, v, i): U
        • Parameters

          • acc: U
          • v: T
          • i: number

          Returns U

    • initial: U

    Returns U

  • Parameters

    • callback: ((v, i) => boolean)
        • (v, i): boolean
        • Parameters

          • v: T
          • i: number

          Returns boolean

    Returns boolean