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

Splits values into two groups. If an element in filter is truthy, the corresponding element in the collection belongs to the first group; otherwise, it belongs to the second group.

Use Array.prototype.reduce() and Array.prototype.push() to add elements to groups, based on filter.

type

<T = any>(arr: T[], filter: boolean[]) => unknown