Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/froebel/repeat.ts>default

A strictly typed utility library.
Go to Latest
function default
import { default } from "https://deno.land/x/froebel@v0.18.0/repeat.ts";

Returns a generator that repeats sequence.

Examples

Example 1

// prints: 1, 2, 3, 1, 2, 3, ...
for (const n of repeat(1, 2, 3))
  console.log(n)

Parameters

...sequence: [T, ...T[]]

Returns

Generator<T>