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 the "Invalid wkhtmltopdf version" error in Frappe or ERPNext? Learn how to fix broken PDFs, install the patched Qt version, and switch to headless Chrome for pixel-perfect modern CSS and custom font support.

Learn how to quickly expose a localhost server to your local network on Windows using netsh portproxy. A step-by-step guide to accessing local apps from any device.

Learn how to enhance your Frappe Desk UI by adding a custom, dynamic top bar. Follow this beginner-friendly, step-by-step tutorial to display user profiles, statuses, and more!