compact.js 276 B

12345678910111213
  1. // Inspired by: http://documentcloud.github.com/underscore/#compact
  2. "use strict";
  3. var isValue = require("../../object/is-value");
  4. var filter = Array.prototype.filter;
  5. module.exports = function () {
  6. return filter.call(this, function (val) {
  7. return isValue(val);
  8. });
  9. };