I have an array arr1, which contains all objects.
var arr1 = [{name:"haha1"},{name:"haha2"}] I also have an object.
var a1 = {name:"haha1"}; So, how do I determine whether a1 is equal to any of the objects in arr1? I tried == but it doesn't check if the properties of the objects are equal.
nameof each object is equal to thenameofa1.arr1is an array of objects and thea1is an object. What do you want? Do you want to see ifa1is contained inarr1, meaning that there is an object with the same value for the name property?