DEV Community

Filtering an array of objects by multiple parameters

Austin on January 12, 2023

First, the goods: function filterByMultipleParams(dataToFilter, paramsToFilterBy) { if ( typeof paramsToFilterBy === "object" && ...
Collapse
 
austinbagwell profile image
Austin

I love it! Thanks Tony, this is much cleaner!

If I'm reading it right, it is doing the same thing (iterating over the data array and filtering vs. every key/value of the params) but with cleaner syntax?

I haven't used Array.every() before. Gonna have to add that to my toolkit.