Skip to content

compact

compact(array)

Removes all nullable values from array.

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