compact.js 155 B

1234567
  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. }