so i have a bad bad logic for this assignment, i need to filter 2 Dimension Array that contains the value of string that input on 2nd array.
So this is the example of the 2-Dim Array
const roles = [ ['roles', 'admin', 'write'] ['roles' ,'admin', 'read'] ['roles', 'member', 'read']]
I need to filter the array that only containts ‘member’ and the result is like this
const result = ['roles', 'member', 'read']
How can i achieve this ?
2
Answers
Had a simple answer by drinking a water and trying get my brain straight hahahaha
this is the answer
If you want to return multiple arrays consisting the same string say "admin"
use filter inplace of find in the above code