reject.js 392 B

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