Returns an OperationFunction that yields distinct elements from the source based on the equals function.
Type of items in the source.
Function to compare elements.
An OperationFunction that yields distinct elements from the source based on the equals function.
const result = distinctBy<number>((a, b) => a % 2 === b % 2)([1, 2, 1, 3, 2, 4]);console.log([...result]); // [1, 2] Copy
const result = distinctBy<number>((a, b) => a % 2 === b % 2)([1, 2, 1, 3, 2, 4]);console.log([...result]); // [1, 2]
Returns an OperationFunction that yields distinct elements from the source based on the equals function.