Having trouble filtering a list using Array.find and filter functions.
Here is the function in question:
setSupplierDetails(supplierId) {
const supplier = this.suppliers.filter(tempSupplier => tempSupplier.id === supplierId)[0];
this.supplierName = supplier.supplierName;
} Encountered Error :
ERROR TypeError: Cannot read property 'filter' of undefined
at AddEditRestockComponent.webpackJsonp.../../../../../src/app/restock/add-edit-restock/add-edit-restock.component.ts.AddEditRestockComponent.setProductRelatedInfo