Having a challenge filtering a multidimensional array with objects within the inner arrays. Despite following examples found here, I'm still unable to successfully filter my array as desired.
let arr = [ { name: 'brent', age: 123 } ];
Although I can see the filter function working when console logging, the result is always returning undefined and I can't figure out why.
let filteredData = [];
let responseData.results = [...]; //The contents of this array are below in the next block
filteredData = responseData.results.forEach((group) =>
{
group.filter(({ customerName }) => customerName.includes(searchTerm));
});
console.log(filteredData); //returns as undefined?
let responseData.results = [
...
]