import { Iterator } from "https://deno.land/x/ahh@v0.13.0/mod.ts";
Creates an Iterator
that yields the iteration count and next
item.
Examples
Example 1
Example 1
import { assert, assertArrayIncludes } from "../test_deps.ts";
import O from "./option.ts";
import I from "./iterator.ts";
const iter = I.fromIter(["hello", "world"]).enumerate();
let item = iter.next();
assert(O.isSome(item));
assertArrayIncludes(item, [0, "hello"]);
item = iter.next();
assert(O.isSome(item));
assertArrayIncludes(item, [1, "world"]);