Possible Duplicate:
How do you determine equality for two JavaScript objects?
Object comparison in JavaScript
I have an array of objects like this:
var my_array = [
{
value1: 5,
value2: 3,
value3: 'test'
},
{
value1: 1,
value2: 1,
value3: 'hello'
}
];
When I grab a new object, it looks like this:
var my_object = {
value1 = 1,
value2 = 1,
value3 = 'hello'
};
How can I loop through my_array to see if it already contains the value of my_object. Also, please don't rely on the property names; references are removed immediately after being added to the array.