Tweakr
    Preparing search index...

    Function difference

    • Creates an array of values from the first array that are not present in the second array.

      Type Parameters

      • T

      Parameters

      • a: T[]

        The array to inspect.

      • b: T[]

        The array containing values to exclude.

      Returns T[]

      A new array containing elements from a that are not found in b.

      difference([1, 2, 3, 4], [2, 4]);
      // → [1, 3]

      1.0.0