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

x/itertools/mod.ts>iter

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

Returns an iterator object for the given iterable. This can be used to manually get an iterator for any iterable datastructure. The purpose and main use case of this function is to get a single iterator (a thing with state, think of it as a "cursor") which can only be consumed once.

Parameters

iterable: Iterable<T> | IterableIterator<T>

Returns

IterableIterator<T>