Hidden class
A hidden class is a JavaScript engine’s internal descriptor of an object’s property layout, used to optimize property access.
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.
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
- arrayAn array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
Related concepts
- interfacealternative to · 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.
- fast propertyused by · An optimized object-property storage strategy that supports efficient direct access through engine-managed layout information.
- inline cacheused by · A runtime optimization mechanism that records the result of a property access or similar operation so the same lookup can be reused quickly on subsequent executions.
- type checkinguses · Type checking is the process of determining whether values, expressions, and operations conform to the type rules or constraints of a programming language or type system.
- TypeScriptused by · TypeScript is a statically typed superset of JavaScript that adds type-system features and is compiled to JavaScript.
- array typeconfigures · An array type is a type specification for an ordered collection whose elements share a specified type and may have a specified length.
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.

