The array to search for duplicate elements.
If true, returns only distinct duplicate values (default: true). If false, returns all duplicate occurrences.
An array containing the duplicate elements found in the input array. If distinct is true, each duplicate appears only once.
Finds duplicate elements in an array.