JSON.stringify(obj1) === JSON.stringify(obj2)
//No generic function to do that at all.
//use Lodash, famous for such must have functions, all efficiently built
//http://lodash.com/docs#isEqual ---
npm install lodash
_.isEqual(object, other);
var object = { 'a': 1 };
var other = { 'a': 1 };
_.isEqual(object, other);
// => true
object === other;
// => false