Is it possible to override the equivalence comparison in Javascript?
The closest I have gotten to a solution is by defining the valueOf function and invoking valueOf
you can use the ES6 Object.is() function to check the property of object.
Object.is()
Object.prototype.equals = function(obj) { if(typeof obj != "Object") return false; for(var property in this) { if(!Object.is(obj[property], this[property])) return false; } return true; }