Interface ISequence<T>

generalized version of Array function similar to Scala ISeq

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

Type Parameters

  • T

Hierarchy (View Summary)

Properties

length: number

Methods

  • Parameters

    • callback: (v: T, i: number) => boolean

    Returns boolean

  • Type Parameters

    • U

    Parameters

    • callback: (acc: U, v: T, i: number) => U
    • initial: U

    Returns U

  • Parameters

    • callback: (v: T, i: number) => boolean

    Returns boolean