partition.js 315 B

123456789
  1. var _group = require('./_group.js');
  2. // Split a collection into two arrays: one whose elements all pass the given
  3. // truth test, and one whose elements all do not pass the truth test.
  4. var partition = _group(function(result, value, pass) {
  5. result[pass ? 0 : 1].push(value);
  6. }, true);
  7. module.exports = partition;