Skip to main content
Module

x/lodash_es/mod.ts>compact

lodash for deno use
Latest
function compact
import { compact } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.

Examples

_.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3]

Parameters

array

The array to compact.