@alanscodelog/utils
    Preparing search index...

    Function findDuplicates

    • Finds all duplicated elements in an array and returns an array containing one of each.

      Can be passed a custom equality function, see equals option.

      Type Parameters

      • T = any

      Parameters

      • arr: T[]
      • __namedParameters: { equals?: (val: T, other: T, found: T[]) => undefined | boolean } = {}
        • Optionalequals?: (val: T, other: T, found: T[]) => undefined | boolean

          Use a custom equality comparison function to check for a complex value's equality (e.g. two different instanced of a class or object might be considered equal if their properties are.)

      Returns T[]