As I work on developing a filter, I am faced with an array containing dynamic values that need to be filtered. Despite being one step away from completing the filter, I am struggling with getting the right loop done. I have attempted using forEach without success. Here is the code snippet:
map(p => (!this.personTypeFilter) ? p:p.filter(((i:any) => this.getPersonTypesBezeichnung(i.personentyp)?.toLowerCase().includes(this.personTypeFilter.forEach((x:any) => { return console.log(this.personTypeFilter[x])))))
//EDIT
The main objective here is to filter an entire array based on multiple checkboxes which are selected and added to a list. My initial attempt was to loop through each checkbox value using forEach, but it turns out that map is actually the correct solution.