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

361
Views
How is __proto__ different from [[Prototype]]?

My understanding on the concept: objects come with a hidden property called __proto__ that provides reference to function object's prototype property. When I create an empty object and log it into the console, I see the property within the object is [[Prototype]] instead of __proto__. Can you provide any insight or correction to my understanding on the concept?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

[[Prototype]] refers to an internal slot of objects - values which are held in the JS engine, but not directly exposed to the running JavaScript. See here for details from the specification.

The value contained in an internal slot can often be retrieved if there are methods that deliberately expose it.

For another example of an internal slot, consider the values of a Set:

const set = new Set();
set.add('someValue');

The someValue is not directly visible on the Set, but it can be accessed through methods which run native code, and that native code accesses the internal slots of the Set to see what it contains - for example, with Set.prototype.has.

In the case of [[Prototype]], the value in that internal slot can be retrieved by invoking the __proto__ getter, which does:

  1. Return ? O.[[GetPrototypeOf]]().

eventually accessing and returning the [[Prototype]] internal slot.

Also, __proto__ is deprecated - you should prefer to use Object.getPrototypeOf and Object.setPrototypeOf.

about 4 years ago · Juan Pablo Isaza Report
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!