Identifies duplicate elements in an array and returns them as a new array.
Returns
An array containing all elements that appear more than once in the input array.
Each duplicate element appears only once in the returned array, regardless of how many times it occurs.
Identifies duplicate elements in an array and returns them as a new array.
Returns
An array containing all elements that appear more than once in the input array. Each duplicate element appears only once in the returned array, regardless of how many times it occurs.
Example
Remarks
Setinternally for efficient duplicate detection.