Returns a Stream that yields distinct elements from the source based on the equals function.
Type of items in the source.
Function to compare elements.
Operation that yields distinct elements from the source.
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 a Stream that yields distinct elements from the source based on the equals function.