Skip to main content
Module

x/itertools/builtins.ts>iter

🦕 A TypeScript port of Python's itertools and more-itertools for Deno
Go to Latest
function iter
import { iter } from "https://deno.land/x/itertools@v1.1.1/builtins.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>