Function repeat

  • Repeat given item the specified amount of times (can be BigInt or Infinity times) as an iterable.

    Example

    const repeatFoo = repeat("foo");
    repeatFoo(3); // ["foo", "foo", "foo"]

    Returns

    Curried function with item in context.

    Type Parameters

    • Item

    Parameters

    • item: Item

      Item to repeat.

    Returns ((times: number | bigint) => IterableIterator<Item>)

      • (times: number | bigint): IterableIterator<Item>
      • Parameters

        • times: number | bigint

        Returns IterableIterator<Item>