2 * Creates an array with all falsey values removed. The values `false`, `null`,
3 * `0`, `""`, `undefined`, and `NaN` are falsey.
9 * @param {Array} array The array to compact.
10 * @returns {Array} Returns the new array of filtered values.
13 * _.compact([0, 1, false, 2, '', 3]);
16 function compact(array) {
18 length = array == null ? 0 : array.length,
22 while (++index < length) {
23 var value = array[index];
25 result[resIndex++] = value;
31 module.exports = compact;