I know that object's(instance's) own property has higher priority than properties in instance's .__proto__. But what is the priority order when we have multiple properties with same name inside instance's .__proto__. Here's my code, I am trying to access c.
const Foo = function (fName,by) {
this.fName = fName;
this.by = by;
}
let a = {};
a.__proto__.c = "hello"
Foo.prototype.a = a;
let b = {};
b.__proto__.c = "bello"
Foo.prototype.b = b;
ins1 = new Foo("Mike",2000);
console.log(ins1.c);
This gives output as "bello". I am unable to find why this is happening and what is the rule by which Js decides this.