@extra-entries/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 extraEntriesFindAllMin from 'https://cdn.skypack.dev/@extra-entries/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-entries.

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


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

var x = [["a", 1], ["b", 2], ["c", 3], ["d", 4]];
[...entries.findAll(x, v => v % 2 === 0)];
// [ 2, 4 ]                      ^                   ^

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


References