compact.js 170 B

123456789
  1. var filter = require('./filter.js');
  2. // Trim out all falsy values from an array.
  3. function compact(array) {
  4. return filter(array, Boolean);
  5. }
  6. module.exports = compact;