Function withoutAll

  • Returns an array excluding all given values.

    Type Parameters

    • T

      The type of the array elements.

    Parameters

    • array: readonly T[]

      The array to exclude values from.

    • values: readonly T[]

      The values to exclude from the array.

    Returns T[]

    A new array containing all elements from the given array except the ones that are in the values array.

    import { withoutAll } from "@std/collections/without-all";
    import { assertEquals } from "@std/assert";

    const withoutList = withoutAll([2, 1, 2, 3], [1, 2]);

    assertEquals(withoutList, [3]);