liveBook · Manning

Prototype

A JavaScript prototype is an object through which other objects can access properties and methods by delegation during lookup.

How 3 Manning books explain it

The Joy of JavaScript

In JavaScript object creation, the prototype is an object that serves as the shared delegate from which other objects can inherit properties and methods.

How it is used
Uses prototypes to share properties and methods across linked JavaScript objects without duplicating them.
How deep it goes
Works through Object.create, property lookup, differential inheritance, and constructor-chain configuration; explicitly defers detailed treatment of property shadowing.
Examples
Models linked transaction objects, shared hash-calculation methods, and constructor-based transaction hierarchies.
What you can do after
Build it from scratch with Object.create or constructor prototypes, and diagnose missing methods by checking prototype-chain links.

Read how The Joy of JavaScript explains prototype →

Secrets of the JavaScript Ninja, Second Edition

An object from which another object can inherit properties in JavaScript.

How it is used
Organizes reusable object properties and methods through delegated lookup and inheritance.
How deep it goes
Works through prototype-chain lookup, constructor-created links, and runtime changes; does not describe engine-level lookup internals.
Examples
Uses linked objects with property checks, a constructor-provided method, and prototypes changed after instantiation.
What you can do after
Build it from scratch by linking objects or assigning shared methods to a constructor's prototype, and predict which instances see later changes.

Read how Secrets of the JavaScript Ninja, Second Edition explains prototype →

Essential TypeScript 5, Third Edition

The prototype system is JavaScript's object-inheritance mechanism in which objects delegate property and method lookup to prototype objects.

How it is used
Explains how JavaScript objects share inherited behavior and how that behavior underlies classes.
How deep it goes
Works through lookup, shared-prototype changes, custom chains, constructors, shadowing, and type checks using code examples.
Examples
Uses hat and boots objects, product constructors, taxed products, and index.js listings to trace shared methods and inheritance.
What you can do after
Build it from scratch with custom or constructor prototypes, and diagnose inherited-method lookup with prototype checks.

Read how Essential TypeScript 5, Third Edition explains prototype →

Related concepts

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.