compact.js 155 B

123456
  1. import filter from './filter.js';
  2. // Trim out all falsy values from an array.
  3. export default function compact(array) {
  4. return filter(array, Boolean);
  5. }