Skip to main content
Module

x/itertools/itertools.ts>islice

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

Returns an iterator that returns selected elements from the iterable. If start is non-zero, then elements from the iterable are skipped until start is reached. Then, elements are returned by making steps of step (defaults to 1). If set to higher than 1, items will be skipped. If stop is provided, then iteration continues until the iterator reached that index, otherwise, the iterable will be fully exhausted. islice() does not support negative values for start, stop, or step.

Parameters

iterable: Iterable<T>
start: number
optional
stop: number | null | undefined = [UNSUPPORTED]
optional
step = [UNSUPPORTED]

Returns

Iterable<T>