liveBook · Manning

Hidden class

Also called object shape

A hidden class is a JavaScript engine’s internal descriptor of an object’s property layout, used to optimize property access.

How 2 Manning books explain it

JavaScript in Depth

An internal object-shape descriptor used by JavaScript engines to represent and optimize objects' property layouts.

How it is used
Explains why predictable object layouts can make property access faster and shape variation can make hot reads slower.
How deep it goes
Traces shape changes and inline-cache states through examples and measurements, while leaving broader engine optimizations aside.
Examples
Contrasts fixed and conditional object factories, then measures property reads across distinct shapes in Node.js 24.
What you can do after
Diagnose/debug with CPU profiles and Node.js optimizer signals, then favor consistent layouts where property access is hot.

Read how JavaScript in Depth explains hidden class →

Essential TypeScript 5, Third Edition

An object shape is the combination of properties associated with a JavaScript object.

How it is used
Uses object shapes to check object literals and class instances for consistent property use.
How deep it goes
Defines shapes and demonstrates inference, type aliases, unions, and intersections; does not describe JavaScript engine internals.
Examples
Shows a todo-count result, a mixed-shape product array with a missing-property error, and subclass arrays requiring annotation.
What you can do after
Diagnose/debug with it when an inferred array type lacks a property, and annotate a class array when broader membership is needed.

Read how Essential TypeScript 5, Third Edition explains hidden class →

What to know first

Related concepts

Questions about hidden class

What is hidden class?

A hidden class is a JavaScript engine’s internal descriptor of an object’s property layout, used to optimize property access.

Which Manning books explain hidden class?

JavaScript in Depth and Essential TypeScript 5, Third Edition.

What should I know before learning hidden class?

Manning books that teach hidden class usually introduce array first.

What is the difference between hidden class and interface?

A hidden class is a JavaScript engine’s internal descriptor of an object’s property layout, used to optimize property access. An interface is a defined contract or boundary that specifies the operations, capabilities, or data shape through which a type or component interacts with others.

What is hidden class also called?

Hidden class is also called object shape.

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.