Skip to content
Subhajit Sahu edited this page Jun 11, 2020 · 13 revisions

Discards entries which pass a test. 🏃 📼 📦 🌔 📒

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

object.reject(x, fn, [ths]);
// x:   an object
// fn:  test function (v, k, x)
// ths: this argument
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