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

Returns a list of elements that exist in both arrays.

Create a Set from b, then use Array.prototype.filter() on a to only keep values contained in b.

type

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