I have an array that contain filter functions that need to be applied to an array of items in Lazy.js. I've tried using a for-loop but only the last filter is applied.
function (searchText) {
var result = Lazy(input);
for (var query of this.querylist) {
result = result.filter((item) => {
return query.filterFunc(item, searchText, query.compareFunc);
});
}
return result.toArray();
}
Is there a way of applying a list of filters without hardcoding the chaining?