Array.filter use array code example
Example 1: angular array filter typescript
ngOnInit() {
this.booksByStoreID = this.books.filter(
book => book.store_id === this.store.id);
}
Example 2: js filter items by index
let newArray = arr.filter(callback(element[, index, [array]])[, thisArg])