Recommended Free Tools
JavaScript finds properties by checking an object first, then following its [[Prototype]] link through a chain until it finds a match or reaches null. Understanding that lookup explains how instances share methods, why an own property can shadow an inherited one, and how class, constructor functions, and Object.create() express the same underlying prototype model.
What a prototype means in JavaScript
Every ordinary JavaScript object has an internal link called [[Prototype]]. The link points to another object, which can have its own prototype link. Together, these links form the prototype chain. When code reads a property, JavaScript checks the object itself first, then each linked prototype in turn. If no object in the chain has that property, lookup ends at null.
This is delegation, not copying: an instance can use a method stored on a shared prototype without having a separate copy of that method as one of its own properties. MDN describes classes as syntax that does not introduce a new inheritance pattern; classes use JavaScript’s prototype-based system (MDN: Inheritance and the prototype chain).
Distinguish [[Prototype]] from .prototype
The similar names refer to different things. [[Prototype]] is an object’s internal link. A function or class’s .prototype is an ordinary property whose object is used as the prototype for instances created with new. The standard inspection function Object.getPrototypeOf(obj) returns the object’s prototype link.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
[[Prototype]]: the internal link on an object that supports inherited lookup.Constructor.prototype: the object that normally becomes the[[Prototype]]of an instance made withnew Constructor().Object.getPrototypeOf(obj): the standard API for inspecting an object’s prototype link.obj.__proto__: a legacy accessor found in JavaScript implementations; preferObject.getPrototypeOf()for inspection. It is different from the standardized object-literal syntax{ __proto__: proto }, which sets the literal’s prototype.
For example, a typical instance created from a constructor has this chain: instance → Constructor.prototype → Object.prototype → null.
Trace a property lookup
A Date instance inherits methods such as getTime() from Date.prototype. The method is available even though it is not an own property of the instance:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
const date = new Date();
Object.getPrototypeOf(date) === Date.prototype; // true
Object.hasOwn(date, "getTime"); // false
date.getTime(); // found on Date.prototype
Object.hasOwn() checks whether a property belongs directly to the object. It is useful when you need to distinguish an own property from one found higher in the chain. For example, a property can exist on an object or its prototype with the value undefined; checking the value alone does not tell you whether the property exists or where it is owned.
Understand shadowing
If an object has its own property with the same name as an inherited property, lookup stops at the nearer own property. This is called shadowing. The inherited property remains on the prototype; the instance’s property takes precedence when accessed through that instance.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
const date = new Date();
date.getTime = () => "custom";
date.getTime(); // "custom"
Here the instance’s own getTime function is found before Date.prototype.getTime. The change affects this date object, not every date instance.
Share methods with a constructor function
Constructor functions make the connection between instance state and shared behavior explicit. Put per-instance values on this inside the constructor, and put methods on the constructor’s .prototype when instances should share them:
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
function Person(name) {
this.name = name;
}
Person.prototype.greet = function () {
return `Hello, ${this.name}`;
};
const ada = new Person("Ada");
ada.greet(); // "Hello, Ada"
With new Person("Ada"), JavaScript creates an instance whose prototype is Person.prototype, then calls the constructor with that instance as this. The instance owns name; the inherited greet method is shared through the prototype.
Use Object.create() to choose a prototype directly
Object.create(proto) creates an object with the supplied object as its prototype, without requiring a constructor function:
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
const personPrototype = {
greet() {
return `Hello, ${this.name}`;
},
};
const ada = Object.create(personPrototype);
ada.name = "Ada";
ada.greet(); // "Hello, Ada"
This approach is useful when direct delegation is clearer than defining a constructor. You can also call Object.create(null) to make an object with no prototype. Such an object does not inherit methods from Object.prototype, so do not assume methods such as hasOwnProperty are available on it. Use Object.hasOwn(obj, key) to test ownership.
How class and extends fit in
Class syntax offers a familiar way to define constructors and prototype methods. It uses the same prototype inheritance mechanism rather than a separate kind of object inheritance:
class Person {
constructor(name) {
this.name = name;
}
greet() {
return `Hello, ${this.name}`;
}
}
class Developer extends Person {}
const ada = new Developer("Ada");
ada.greet(); // "Hello, Ada"
The instance’s greet() lookup follows the class prototype chain: Developer.prototype links to Person.prototype, which links to Object.prototype, then null. The instance’s name is its own property, initialized by the inherited constructor.
Choose the construction style that makes the relationship clear
| Approach | How the prototype relationship is established | When it is useful |
|---|---|---|
class and extends |
Class syntax sets up the prototype relationships. | A readable, familiar choice for many modern examples and codebases. |
Constructor function and new |
The instance receives the constructor’s .prototype as its [[Prototype]]. |
Useful for understanding existing code and seeing how instances share prototype methods. |
Object.create(proto) |
The chosen prototype is supplied directly at object creation. | Useful when direct delegation is desired without a constructor function. |
These options differ mainly in how they express object creation and how familiar they will be to the people maintaining the code. The mechanism is prototype delegation in each case; there is no universally best style or supported performance winner among them.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Quick Recap
Prototype pitfalls to avoid
- Do not use
__proto__as your inspection API. UseObject.getPrototypeOf(obj)instead. - Avoid routine prototype changes after object creation. Establish the intended relationship when creating objects where practical; changing prototypes can affect performance and code behavior.
- Keep inheritance chains understandable. Very long or complicated chains can create maintenance challenges and may cause performance problems; there is no universal chain-length threshold.
- Do not extend built-in prototypes in ordinary application code. MDN advises against it except when supporting compatibility with newer JavaScript features (MDN guidance).
- Be careful when replacing a constructor’s entire
.prototypeobject. A replacement can remove the conventionalconstructorproperty, which can confuse code that relies on it. - Do not infer absence from an
undefinedvalue. Use an ownership or existence check when the distinction matters.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

