@extra-map/filter.min

Keeps entries which pass a test.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-map/filter.min
312.2.152 years ago2 years agoMinified + gzip package size for @extra-map/filter.min in KB

Readme

Keeps entries which pass a test. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
Alternatives: filter, filter$.
Similar: map, reduce, filter, filterAt, reject, rejectAt.

This is part of package extra-map.

This is browserified, minified version of @extra-map/filter.
It is exported as global variable mapfilter.
CDN: unpkg
, jsDelivr.



map.filter(x, ft);
// x:  a map
// ft: test function (v, k, x)

const map = require("extra-map");

var x = new Map([["a", 1], ["b", 2], ["c", 3], ["d", 4], ["e", 5]]);
map.filter(x, v => v % 2 === 1);
// Map(3) { "a" => 1, "c" => 3, "e" => 5 }

map.filter(x, v => v % 2 === 0);
// Map(2) { "b" => 2, "d" => 4 }



References