@amphibian/find

matches items in an array or object that return true in the finding function

Usage no npm install needed!

<script type="module">
  import amphibianFind from 'https://cdn.skypack.dev/@amphibian/find';
</script>

README

find

build status

matches items in an array or object that return true in the finding function

npm install @amphibian/find
var find = require('@amphibian/find');
var array = ['zero', 'one', 'two', 'three', 'four'];

find(array, (index, i) => i === 2); // > 'two'

var object = {
    zero: {hello: true},
    one: {hello: false},
    two: {hello: true},
    three: {hello: false}
};

find(object, (key, value) => value.hello === true); // > {hello: true}