Possible Duplicate:
Object comparison in JavaScript
Is there any method that takes in 2 JSON objects and compares the 2 to see if any data has changed?
Edit
After reviewing the comments, some clarification is needed.
A JSON object is defined as
"an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma)." -- json.org
My goal is to be able to compare 2 JSON object literals, simply put.
I am not a javascript guru so if, in javascript, these are object literals, then I suppose that's what I should call them.
I believe what I am looking for is a method capable of:
- Deep recursion to find a unique name/value pair
- Determine the length of both object literals, and compare the name/value pairs to see if a discrepancy exists in either.