Object comparison in JavaScript

http://stackoverflow.com/questions/1068834/object-comparison-in-javascript

Why not JSON.stringify it then compare?

  1. JSON.stringify removes properties that are set to undefined.
  2. What if the data is the same but the order of the keys is different?
  3. String performance.