JavaScript Prototypes Explained prototype vs proto


Open your browser console. Type console.dir([]). Expand the array.
What do you see? A property called [[Prototype]] (or sometimes __proto__). ๐ง
If youโve ever stared at that and wondered, "What on earth is the difference between prototype and __proto__?"โyou are not alone. It is one of the most confusing concepts in JavaScript, yet it is the backbone of how the entire language works.
Letโs break it down like an expert. ๐จ
To understand this, we need to separate two distinct concepts:
prototype): This belongs to functions (specifically, constructor functions). __proto__): This belongs to objects (instances). prototype: The Blueprint ๐In JavaScript, functions are objects. When you create a function, JavaScript automatically gives it a special property called prototype.
Think of this as a Blueprint Box. Itโs where you put methods and properties that you want future instances to inherit.
function Robot(name) {
this.name = name;
}
// Adding a method to the Blueprint
Robot.prototype.speak = function() {
console.log("Beep Boop ๐ค");
};Here, Robot.prototype is the object that will become the parent of any new robot we create.
__proto__: The DNA Link ๐งฌNow, letโs create an instance:
const myBot = new Robot("R2-D2");When myBot is born, JavaScript secretly links it to its parent's blueprint. This secret link is exposed in many browsers as __proto__.
console.log(myBot.__proto__ === Robot.prototype); // true โ
In simple terms:
Robot.prototype is the parent's stash of skills. myBot.__proto__ is the child's wire connecting to that stash. When you inspect an object in Chrome or Firefox, you are looking at the instance.
[[Prototype]] (or __proto__) because the browser is showing you who created this object. This chain of links is what we call the Prototype Chain. โ๏ธ
While __proto__ is widely supported, it was originally a non-standard feature. The "proper" modern way to access an object's prototype is:
Object.getPrototypeOf(myBot);But letโs be realโwe all still peek at __proto__ in the console for debugging. ๐
| Property | Who has it? | What does it do? |
|---|---|---|
prototype | Functions (Constructors) | It's the Blueprint. It defines what instances will look like. |
__proto__ | Objects (Instances) | It's the Link. It points back to the blueprint that created the object. |
Want to master the depths of JavaScript? Check out these industry-standard resources:
Now go forth and debug that console with confidence! ๐

Getting Permission denied in Frappe? Learn why it happens and how to fix file ownership issues in your bench with one simple command.

Learn how to check and set your Git user.name and user.email for all projects (global) or a single repo (local). Fix your GitHub commit identity.

Stop fighting Git permissions in WSL. This post explains the root cause of the 'Permission Denied' error and shows you the permanent fix.