compact.js 179 B

1234567891011
  1. define(['./filter'], function (filter) {
  2. // Trim out all falsy values from an array.
  3. function compact(array) {
  4. return filter(array, Boolean);
  5. }
  6. return compact;
  7. });