Is there a way to compare two un-referenced objects by their literal value like a string or a number?
_is = function (a, b) { /* Code */ }
This could apply to any object type, even custom objects.
_is(new X("a"), new X("a")); // Returns True;
_is(new X("a"), new Y("a")); // Returns False
You could convert it into a string, but that would be sloppy.
JSON.stringify({ x: "a" }) == JSON.stringify({ x: "a" }); // Returns True
Maybe there's a way to programatically read each key, subkey, and value of the object, and compare that way.
Any ideas?