reject.js 411 B

12345678910111213141516
  1. var filter = require('./filter');
  2. var makeIterator = require('../function/makeIterator_');
  3. /**
  4. * Inverse or collection/filter
  5. */
  6. function reject(list, iterator, thisObj) {
  7. iterator = makeIterator(iterator, thisObj);
  8. return filter(list, function(value, index, list) {
  9. return !iterator(value, index, list);
  10. }, thisObj);
  11. }
  12. module.exports = reject;