@lucid-softworks/array-compact
v0.1.0
Published
Remove nullish values from an array without removing other falsy values.
Maintainers
Readme
@lucid-softworks/array-compact
Remove null and undefined from an array while preserving useful falsy
values. Unlike Lodash's compact, this does not discard 0, false, "",
or NaN.
import { compact } from "@lucid-softworks/array-compact";
compact([0, null, 1, undefined, false]);
// [0, 1, false]The input is never mutated, and the returned element type excludes nullish values.
