@extra-set/find-all.min

Finds values passing a test. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Usage no npm install needed!

<script type="module">
  import extraSetFindAllMin from 'https://cdn.skypack.dev/@extra-set/find-all.min';
</script>

README

Finds values passing a test. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: find, findAll.
Similar: find, search, searchValue.

This is part of package extra-set.

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


set.findAll(x, ft);
// x:  a set
// ft: test function (v, v, x)
const set = require("extra-set");

var x = new Set([1, 2, 3, 4]);
set.findAll(x, v => v % 2 === 0);
// [ 2, 4 ]                      ^                   ^

set.findAll(x, v => v % 8 === 0);
// []


References