compact.js 179 B

12345678910
  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. });