TS-Scribe - v0.6.2
    Preparing search index...

    Function arrayIntersectionDeep

    • Find the intersection of multiple arrays using deep equality comparison.

      This function returns a new array containing the elements that are present in all provided arrays, where deep equality is used to compare elements. Deep equality comparison ensures that objects are compared by value, not by reference.

      Type Parameters

      • T

      Parameters

      • ...arrays: T[][]

        The arrays to find the intersection of.

      Returns T[]

      An array containing elements that are present in all arrays.

      const result = arrayIntersectionDeep([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], [{ id: 2 }]);
      console.log(result); // Output: [{ id: 2 }]