0

enter image description here

I have a array like this which has same tid i want to compare this array and display error message as duplicate ID is present

chethu
  • 386
  • 1
  • 3
  • 26

1 Answers1

1

Something like this should do it:

array.forEach(function(e,i){
  for (var j = i+1; j < array.length; j++) {
     if (e.Tid == array[j].Tid) {
        // ids match, do something
     }
   }
 });
cmac
  • 3,123
  • 6
  • 36
  • 49