Function repeat

  • Create an iterator which repeats a value a number of times.

    Type Parameters

    • T

    Parameters

    • value: T

      The value to repeat.

    • count: number

      The number of times to repeat the value.

    Returns IterableIterator<T>

    A new iterator which repeats the specified value.

    Example

    import { repeat } from '@lumino/algorithm';

    let stream = repeat(7, 3);

    Array.from(stream); // [7, 7, 7]

    Deprecated