import { enumerate } from "https://deno.land/x/itertools@v1.1.2/mod.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>