@extra-map/find.min

Finds a value passing a test.

Downloads in past

Stats

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

Readme

Finds a value passing a test. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
Alternatives: find, findAll.
Similar: find, search, searchValue.

This is part of package extra-map.

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



map.find(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]]);
map.find(x, v => v % 2 === 0);
// 2                             ^

map.find(x, v => v % 8 === 0);
// undefined



References