Nagarajan Elumalai

Nagarajan Elumalai

  • 1.7k
  • 165
  • 5.6k

Compare Two Arrary objects and check if any matched value

Sep 24 2019 8:25 AM
Hi,
 
I need to compare these two array with both col1 and col2 value if value matched then i need to show alert to the user as value matched if not alert should be as not matched. Note:Need to compare both the column(col1,col2) with second array(col1,col2).
 
array1:
0:{col1:"a",col2:"Chennai"}
1:{col1:"b",col2:"Chennai"}
2:{col1:"c",col2:"Chennai"}
3:col1:"a",col2:"Madurai"}
4:{col1:"a",col2:"Trichy"}
5:{col1:"b",col2:"Madurai"}
6:{col1:"C",col2:"Salem"}
array2: 0:{col1:"a",col2:"Chennai"}

Answers (4)