typescript filter array in array code example
Example 1: angular array filter typescript
ngOnInit() {
this.booksByStoreID = this.books.filter(
book => book.store_id === this.store.id);
}
Example 2: typescript filter list by property
const object = {
firstAttribute: 'firstValue',
secondAttribute: 'secondValue'
};
objectList.filter(o -> o.firstAttribute === 'firstValue');
Example 3: filter typescript
this.booksByStoreID = this.books.filter(book => book.store_id === this.store.id);