Skip to main content
variable unionBy
import { unionBy } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Returns every element that exists in any of the two arrays once, after applying the provided function to each array element of both.

Create a Set by applying all fn to all values of a. Create a Set from a and all elements in b whose value, after applying fn does not match a value in the previously created set. Return the last set converted to an array.

type

(
a: any[],
b: any[],
fn: MapFunc,
) => unknown