It will filter out the falsey values from the provided array.
array
1.0.0
compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]);// => [ 1, 2, 3, 'a', 's', 34 ] Copy
compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]);// => [ 1, 2, 3, 'a', 's', 34 ]
It will filter out the falsey values from the provided
array
.