Estoy intentando filtrar los productos de un array para asi mostrarlos, si funciona el filtro pero como puedo hacer para que retorne un valor si no encuentra coincidencia? por ahora tengo mi filtro asi:
findproduct: function() {
if (this.product === "") {
this.listFinishedproducts = this.filterFinishedproducts;
}else {
this.listFinishedproducts = this.filterFinishedproducts.filter(products => {
return products.room.match(this.product.toLowerCase())
|| products.name.match(this.product.toLowerCase())
|| products.lot.match(this.product.toLowerCase())
|| products.quantity_packed.match(this.product.toLowerCase())
|| products.pallet.match(this.product.toLowerCase());
});
}
}