• Drops the prefix of length count. If count >= length(list), the empty list will be returned.

    Parameters

    • count: number

      The length to drop.

    Returns (<T>(list) => List<T>)

    The dropped list.

    Examples

    import { drop, range, toIterator } from "./list.ts";
    import { assertEquals } from "../deps.ts";

    const dropped = drop(2)(range(1, 6));
    const iter = toIterator(dropped);
    assertEquals(iter.next(), { value: 3, done: false });
    assertEquals(iter.next(), { value: 4, done: false });
    assertEquals(iter.next(), { value: 5, done: false });
    assertEquals(iter.next(), { value: undefined, done: true });
      • <T>(list): List<T>
      • Type Parameters

        • T

        Parameters

        Returns List<T>

Generated using TypeDoc