Union two arrays by predicate
两个数组的并集,根据 predicate 函数进行比较
The first array to union / 第一个数组
The second array to union / 第二个数组
The function to use to transform each element for deduplication / 用于每个元素的 predicate 函数以进行去重
The array with duplicates removed / 去重后的数组
unionBy([1, 2, 3], [2, 4, 5, 6], (item) => item % 2) // => [1, 2]unionBy([1, 2], [3, 4], (item) => item % 2) // => [1, 2] Copy
unionBy([1, 2, 3], [2, 4, 5, 6], (item) => item % 2) // => [1, 2]unionBy([1, 2], [3, 4], (item) => item % 2) // => [1, 2]
Union two arrays by predicate
两个数组的并集,根据 predicate 函数进行比较