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