@extra-lists/find-all

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

Usage no npm install needed!

<script type="module">
  import extraListsFindAll from 'https://cdn.skypack.dev/@extra-lists/find-all';
</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-lists.


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

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

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


References