javascript find matches in objects code example
Example 1: find match in array object js
function findByMatchingProperties(set, properties) {
return set.filter(function (entry) {
return Object.keys(properties).every(function (key) {
return entry[key] === properties[key];
});
});
}
Example 2: find in js
The first element that will be found by that function
const f = array1.find(e => e > 10);