Q:

Return a specific object in array angular

I am starting to work with angular. i need to return the object that matches the search or atleast includes that. Please advise, i am currently returning all objects
return items.filter( it => {
    console.log('awe', it[0].quoteOrderId.includes(searchText);
    if(it[0].quoteOrderId.includes(searchText) == true){
        console.log("we need the specific object returned");
    }
    else{
      return it;
    }
    });

}

A:

return items.filter( it => {
    if (it[0].quoteOrderId.includes(searchText) == true){
        const found = it.find(function(response){
            return response;
        })
        return found;
    }
    else {
      return '';
    }
    });
   }

this is what i was looking for

