compact.js 273 B

1234567891011
  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) { return isValue(val); });
  7. };