Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ahh/src/iterator.ts>Iterator#interlace

Opinionated idiomatic features for TypeScript.
Latest
method Iterator.prototype.interlace
import { Iterator } from "https://deno.land/x/ahh@v0.14.0/src/iterator.ts";

Creates an Iterator that yields items from this and other interlacedly.

Examples

Example 1

import { assert } from "../test_deps.ts";
import I from "./iterator.ts";

const iter = I.fromIter([1, 3, 5]).interlace(I.fromIter([2, 4]));

assert(iter.next() === 1);
assert(iter.next() === 2);
assert(iter.next() === 3);
assert(iter.next() === 4);
assert(iter.next() === 5);