@akashrajpurohit/utils
    Preparing search index...

    Function arrayDifference

    • A utility function that returns the difference between two arrays.

      Type Parameters

      • T

      Parameters

      • array1: T[]

        The first array.

      • array2: T[]

        The second array.

      Returns T[]

      An array containing the difference between the two arrays.

      arrayDifference([1, 2, 3], [2, 3, 4]) // [1]
      
      arrayDifference([1, 2, 3], [4, 5, 6]) // [1, 2, 3]