Skip to content

filterAt

Subhajit Sahu edited this page Jun 12, 2020 · 12 revisions

Gets object with given keys. 🏃 [:vhs:] 📦 🌔 📒

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

object.filterAt(x, ks);
// x:  an object
// ks: keys
const object = require('extra-object');

var x = {a: 1, b: 2, c: 3, d: 4, e: 5};
object.filterAt(x, ['a', 'c', 'e']);
// { a: 1, c: 3, e: 5 }

object.filterAt(x, ['b', 'd']);
// { b: 2, d: 4 }

references

Clone this wiki locally