Skip to content
Advertisement

filter array based on another arrays dynamically

I am new to JS. I want to apply filter on array based on other arrays. For example : Filter data array based on property names from colNames and values from Values array. The colNames and Values arrays can have any length (not always 2).

JavaScript

Expected Outcome

JavaScript

Advertisement

Answer

You could filter with the iteration of all keys and check with the values.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement