I want to filter out object data based on value from an array. The below snippet work fine when no null value, but in case of null value in column it's not working.
Here is StackBlitz
filter() { this.dataSource.data = ELEMENT_DATA.filter(({ name }) => this.filterArray.some(n => name.toLowerCase().includes(n.toLowerCase())) ); }
filter() { this.dataSource.data = ELEMENT_DATA.filter(({ name }) => this.filterArray.some(n => name ? name.toLowerCase().includes(n.toLowerCase()) : "") ); }
1.4m articles
1.4m replys
5 comments
57.0k users