liveBook · Manning

Prototype-based object orientation

Also called Prototypal inheritance, prototype-based inheritance

Prototype-based object orientation is an object model in which objects inherit properties and behavior through links to other objects, called prototypes.

How 4 Manning books explain it

The Joy of JavaScript

An inheritance style in which an object delegates property and method lookup to objects linked in its prototype chain.

How it is used
Models reusable object behavior through prototype links in JavaScript domain objects.
How deep it goes
Works through Object.create, prototype inspection, and implicit property lookup, while contrasting linking with copied properties.
Examples
Uses linked transaction and money-transaction objects to show shared sender data and an addFunds method.
What you can do after
Build it from scratch with Object.create and evaluate when delegation or property copying better fits an object model.

Read how The Joy of JavaScript explains prototype-based object orientation →

Secrets of the JavaScript Ninja, Third Edition

Prototypal inheritance is an inheritance model in which objects obtain properties and methods through links to other objects.

How it is used
Explains how JavaScript objects inherit properties and methods and how class syntax relates to that model.
How deep it goes
Traces constructor-created prototype links, inherited-property fallback, and prototype-free objects, without detailing the full inheritance model.
Examples
Demonstrates an inherited Ninja method, `{}` inheriting `toString`, and `Object.create(null)` lacking that method.
What you can do after
Build a constructor-created object that inherits a method from its constructor’s prototype.

Read how Secrets of the JavaScript Ninja, Third Edition explains prototype-based object orientation →

Secrets of the JavaScript Ninja, Second Edition

An object-oriented model in which objects inherit properties through prototype links rather than class inheritance.

How it is used
Frames prototypes as JavaScript’s object-orientation model and cautions against applying class-based expectations.
How deep it goes
Contrasts prototypes with class inheritance and signals deeper coverage of their operation and implementation, but gives no mechanics here.
Examples
Uses Java-trained developers who write class-based code in JavaScript and are surprised by the results.
What you can do after
Understand that JavaScript uses prototypes rather than class-based object orientation.

Read how Secrets of the JavaScript Ninja, Second Edition explains prototype-based object orientation →

JavaScript in Depth

A JavaScript inheritance model in which objects delegate property lookup to linked prototype objects rather than copying properties or relying on class-based inheritance.

How it is used
Explains how JavaScript shares object behavior and resolves missing properties without class-based inheritance.
How deep it goes
Traces prototype lookup, live mutation, reassignment, and this binding, but does not detail runtime implementation internals.
Examples
Uses shared drawer prototypes, open and close methods, changing prototypes, and labels stored on individual drawer objects.
What you can do after
Apply prototype inheritance with Object.create(), modify shared prototypes, change prototype links, and preserve receiver-specific this behavior.

Read how JavaScript in Depth explains prototype-based object orientation →

Also covered in

What to know first

Related concepts

Questions about prototype-based object orientation

What is prototype-based object orientation?

Prototype-based object orientation is an object model in which objects inherit properties and behavior through links to other objects, called prototypes.

Which Manning books explain prototype-based object orientation?

The Joy of JavaScript, Secrets of the JavaScript Ninja, Third Edition, Secrets of the JavaScript Ninja, Second Edition and JavaScript in Depth.

What should I know before learning prototype-based object orientation?

Manning books that teach prototype-based object orientation usually introduce this first.

What is the difference between prototype-based object orientation and classical inheritance?

Prototype-based object orientation is an object model in which objects inherit properties and behavior through links to other objects, called prototypes. An inheritance model in which relationships are defined through classes and are typically fixed as part of compiled program structure.

What are the parts of prototype-based object orientation?

Prototype-based object orientation includes prototype chain.

What is prototype-based object orientation also called?

Prototype-based object orientation is also called Prototypal inheritance or prototype-based inheritance.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.