Skip to content
Subhajit Sahu edited this page Dec 8, 2022 · 13 revisions

Discard entries which pass a test.

Alternatives: reject, reject$.
Similar: reject, rejectAt.
Similar: map, reduce, filter, reject.


function reject(x, ft)
// x:  an object
// ft: test function (v, k, x)
const object = require('extra-object');

var x = {a: 1, b: 2, c: 3, d: 4, e: 5};
object.reject(x, v => v % 2 === 1);
// → { b: 2, d: 4 }

object.reject(x, v => v % 2 === 0);
// → { a: 1, c: 3, e: 5 }


References

Clone this wiki locally