I need to check if an object is logically in an array, when two object are logically equals(Just like the equals
in Java), it will be treated as "in" the array
While I use $.inArray
of jQuery
to test below code, it retuans -1,indicating that the copied one is not treated as "in" the array.
var a =[{value: "G27", title: "G27"}];
$.inArray({value: "G27", title: "G27"},a); //returns -1
Above is just an example ,Is there an easy way for generic cases to achieve that