Question: I have this array that have a nested array that I want to loop to find a specific value.
arr = [['123456','234567'], ['345678']];
specificValue = '123456';
The output that I want is to find out if there's a value same with specificvalue and return this value?
I tried
arr.filter(id => id === specificValue);
Thanks for the help
includeswith thefilteryou're currently using._.flattenDeep(arr).find(specificValue).arr.flat().filter(id => id === specificValue);arris an array. The elements inarrare arrays. Have a look at the other methods ofArray(but it would also already work with just.filter())