My logic for this assignment is not very good, as I need to filter a 2D array based on the values of another array.
Let me provide an example of the 2-Dimensional Array:
const roles = [ ['roles', 'admin', 'write'], ['roles' ,'admin', 'read'], ['roles', 'member', 'read']]
I am looking to filter the array to only include elements that contain 'member'. The desired result would be:
const result = ['roles', 'member', 'read']
Any tips on how I can accomplish this task?