Skip to main content
Module

x/dom_diff/deps.ts>enumerate

The real DOM diffing
Latest
function enumerate
import { enumerate } from "https://deno.land/x/dom_diff@1.0.0-beta.2/deps.ts";

Returns an iterable of enumeration pairs. Iterable must be a sequence, an iterator, or some other object which supports iteration. The elements produced by returns a tuple containing a counter value (starting from 0 by default) and the values obtained from iterating over given iterable.

Example:

import { enumerate } from 'itertools';

console.log([...enumerate(['hello', 'world'])]);
// [0, 'hello'], [1, 'world']]

Parameters

iterable: Iterable<T>
optional
start: number

Returns

Iterable<[number, T]>