cachaito
4/30/2015 - 11:21 PM

Compare with JSON.stringify()

  1. Works when you have simple JSON-style objects without methods and DOM nodes inside
  2. The ORDER of the properties IS IMPORTANT, so this method will return false for following objects: x = {a: 1, b: 2}; y = {b: 2, a: 1};
JSON.stringify(obj1) === JSON.stringify(obj2);