The JavaScript underscore library provides various functions for working with arrays, objects, and other data types. One of these functions is `_.compact`, which returns a new array with all the falsy values removed.
For example, if you have an array `arr = [0, 1, false, 2, '', 3]`, calling `_.compact(arr)` will return `[1, 2, 3]`.
Determine Package Library: The `_.compact` function is part of the underscore library.
JavaScript _.compact - 22 examples found. These are the top rated real world JavaScript examples of Underscore._.compact extracted from open source projects. You can rate examples to help us improve the quality of examples.