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

x/itertools/mod.ts>cycle

🦕 A TypeScript port of Python's itertools and more-itertools for Deno
Go to Latest
function cycle
import { cycle } from "https://deno.land/x/itertools@v1.1.1/mod.ts";

Returns an iterator producing elements from the iterable and saving a copy of each. When the iterable is exhausted, return elements from the saved copy. Repeats indefinitely.

Parameters

iterable: Iterable<T>

Returns

Iterable<T>