I'm trying to remove an object that resides in an array of objects, based on the value that is located in an array inside that object.
The data structure that I have right now is like this:
[
{name:['tutorial', 1, 'langkah'], value:"ABC"},
{name:['tutorial', 2, 'langkah'], value:"DEF"},
{name:['tutorial', 3, 'langkah'], value:"GHI"}
]
I would like to remove an object that has the name value of 1 in the name array.
I've tried to replicate the potential solution by using Object.keys found in here: remove object inside array inside an object based on id in javascript but I couldn't wrap my head around the different data structure.
arris your array, thenarr.filter(obj => !obj.name.includes(1))or if you want to check only 2nd element, thenarr.filter(obj => obj.name[1] != 1)