• Splits one list into two at index.

    Parameters

    • index: number

      The boundary of split.

    Returns (<T>(list) => [List<T>, List<T>])

    The tuple of split lists.

    Examples

    import { range, splitAt, toArray } from "./list.ts";
    import { assertEquals } from "../deps.ts";

    const [left, right] = splitAt(2)(range(1, 6));
    assertEquals(toArray(left), [1, 2]);
    assertEquals(toArray(right), [3, 4, 5]);

Generated using TypeDoc