Compact removes all falsy values [false, null, 0, "", undefined, NaN]
from an array.
array
(Array): input array
(Array): the input array w/ no falsy values
const result = arrays.compact([1, false, 2, null, 3, 0, 4, "", 5, undefined, 6, NaN]);
console.log(result);
> [1, 2, 3, 4, 5, 6]