Skip to content Skip to sidebar Skip to footer

Compare Vales And Find The Missing

In the following JSON data, A item has 'gluten' in the allergyfree string while B item doesn't. I can add a

Yes

to A item but I also want to add a

No

Solution 1:

You could use $.inArray function it returns position of item in array and -1 if item is not present :

if ($.inArray(alergy,allergyfree)!=-1) 

Post a Comment for "Compare Vales And Find The Missing"