Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

77
Views
Multiple Prototype property with same name in Prototype Chain

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!