I have this data and need to apply all the filters using lodash. The final output is blank.
filters = [{'gender':'M'}, {'division':'police'}]
data = [{'name':'tom', 'gender':'M', 'division':'police'},
{'name':'bob' , 'gender':'M', 'division':'police'},
{'name':'dave' , 'gender':'F', 'division':'IT'},
]
data = _.filter(data, function(item){
_.forEach(filters, function(filter){
data_found = _.filter([item], filter)
console.log('data_found - ', data_found)
})
})
console.log(data)