Skip to content

compact

Array.compact(array)

Removes all nullable values from array.

Example

ts
import { Array } from "@monstermann/array";

Array.compact([1, null, undefined]); // [1]
ts
import { Array } from "@monstermann/array";

pipe([1, null, undefined], Array.compact()); // [1]