Answer and Explanation:
Using Javascript:
Class Dog{
var healthScores=[];
Constructor(name, age, ...healthScores) {this.name=name;
this.age=age;
this.healthsScores=healthScores;
}
checkObject(new Dog){
If(new Dog.name===this.name,new Dog.age===this.age, new Dog.healthScores===this.healthScores){return true;
}
else{
console.log("objects are not equal");
}
}
}
To call the method checkObject:
var Tesa = new Dog(Tes,1,[45,46,82]);
var Bingo = new Dog(bing,2,[43,46,82]);
Bingo.checkObject(Tesa);
Note: we have used ES6(latest version of Javascript) where we passed the healthScore parameter(which is an array) to our constructor using the spread operator.