Hello, I’m trying to make a filterable list.
The data structure is like so:
data = [
{name: ‘john’, position: ‘developer’, languages: [‘python’, ‘ruby’, ‘html’},
{name: ‘jane’, position: ‘sales’, languages: [‘python’, ‘ruby’, ‘html’},
{etc}
]
filterLanguage = [‘python’, ‘ruby’, ‘etc’]
I’m trying to filter the main data list languages based on the filters selected in the second array ‘filterLanguage’.
I feel like i’ve been going around and around for hours on this.
I’ve tried various combinations of .filter(), .includes(), .some(), .every(), .indexOf(). etc. I feel like I’m just missing something.
Any help would be greatly appreciated! Thank you
(edited to put in correct subforum)