• Converts the list into a Generator iterator.

    Type Parameters

    • T

    Parameters

    • list: List<T>

      The list to be converted.

    Returns Generator<T, void>

    The generator of elements.

    Examples

    import { iota, successors, toIterator } from "./list.ts";
    import { assertEquals } from "../deps.ts";

    const iter = toIterator(iota);
    assertEquals(iter.next(), { value: 0, done: false });
    assertEquals(iter.next(), { value: 1, done: false });
    assertEquals(iter.next(), { value: 2, done: false });
    assertEquals(iter.next(), { value: 3, done: false });

Generated using TypeDoc