In my Ajax success function data, I am getting a list of objects. I have one more array list with objects which are of same type. How to write a condition to check if that object contains in my list?
//In my Ajax Success function
$.each(data, function(index, item) {
//This is my another array list
var target = [];
target = self.target();
//Need to check the condition whether the above "item" is in my above array list
I am doing something like this, its not working
if (target.indexOf(item) !== -1) {
//item is not present in the above target array list
console.log(item);
} else {
console.log(item.FullName);
}