I have a state in the JSON format below, and I also have a checkbox state for when categories gets selected.

```
initialData = [
  { store_name: 'Shop 1',
    women: false,
    men: false,
    kids: true},
  { store_name: 'Shop 2',
    women: true,
    men: false,
    kids: false},
  { store_name: 'Shop 3',
    women: false,
    men: true,
    kids: true}
]

```

How do I write update the showFilteredResults function that filters initialData based on the filteredArray?

i.e. if filteredArray = ['kids', 'men'], output should return data for key 0 (shop 1) and key 2 (shop 2) where kids = true OR men = true. The current function I have shows all results.

```

const [initialData, setInitialData] = useState([{}])

const [Filters, setFilters] = useState({
        categories: []
    })

//tried the function below, which does not work
const showFilteredResults = (filteredArray) => {
   let filteredResults = initialData.filter( function(main_el) {
       return filteredArray.filter(function(e){
           return main_el.e ===true;})
});

```