0

How to compare the array of an object with the array.

Array Comparing : ['Men','Women']

Array Object

var obj = [{
{'id':1,'value':['Men','Women','Animal']},
{'id':2,'value':['Men','Women']},
{'id':3,'value':['Women','Animal']},
{'id':4,'value':['Animal']},
{'id':5,'value':['Men']}
}]

After Comparision result should be

obj = [{
{'id':2,'value':['Men','Women']},
{'id':5,'value':['Men']}
}]

Is there any direct method? I don't want to use 2 loops and index operation.

Kunal Vashist
  • 2,380
  • 6
  • 30
  • 59

0 Answers0