I have below code in node -
function ABC(a,b,c) {
this.a = a;
this.b = b;
this.c = c;
this.equals = function(other) {
return other.a == this.a &&
other.b == this.b &&
other.c === this.c;
};
}
var a1 = new ABC("1", "1", 0.94924088690462316);
var a2 = new ABC("1", "1", 0.94924088690462316);
console.log(a1 === a2);
var arr = [a1];
console.log(arr.includes(a2));
This code outputs is -
false
false
how can I check whether the array includes the specific object is true?
truebecause their properties and values are all the same?