Skip to content

xdash API Reference v0.5.14


xdash API Reference / compact

Function: compact() ​

compact<T>(arr): T[]

Defined in: src/array.ts:95

Compacts an array by removing null and undefined values.

Type Parameters ​

T ​

T

Parameters ​

arr ​

(undefined | null | false | 0 | T)[]

array to compact

Returns ​

T[]

the compacted array

Released under the MIT License.