A prototype is an object-linked reference target used for property delegation. If an object lacks a property, JavaScript follows its [[Prototype]] reference, continuing up the chain until it finds the property or reaches null. The relationship is live: several objects can share one prototype, and later prototype changes become visible to all of them. section 5.3 section 5.3.1
Use these rules to reason about prototype behavior:
- Read operations search the object first, then its prototype chain; writes usually create an own property, which shadows a prototype data property. section 5.3.1
- Accessor properties change assignment behavior: a prototype setter can receive the assignment while operating with this bound to the receiving object. section 5.3.1 section 5.3.2
- Inspect precisely with Object.getPrototypeOf(), test chain membership with in, and test direct ownership with Object.hasOwn(); truthiness does not establish property existence. section 5.3.2
- Object.create() selects a prototype directly, while Object.setPrototypeOf() changes an object's linkage; ordinary chains commonly end at Object.prototype and then null. section 5.3 section 5.3.1
A shared, mutable prototype
const drawerPrototype = { open() { console.log('Opening drawer'); } }; const drawer1 = Object.create(drawerPrototype); const drawer2 = Object.create(drawerPrototype); drawerPrototype.close = function() { console.log('Closing drawer'); }; drawer1.close(); drawer2.close(); Both drawers resolve close through the same live prototype rather than receiving copied methods.
What new performs
new creates an object, links it to the constructor's prototype, calls the constructor with this bound to that object, and returns the constructor's object result when one is supplied. This makes constructor-based prototype linkage a sequence of observable operations rather than a mysterious instance step. section 6.1.1




