Reputation: 374
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
Upvotes: 0
Views: 491
Reputation: 3268
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
}
}
});
Upvotes: 1