Object concepts

Nested object

Try the free JavaScript compiler

An object property can hold another object. Accessing nested data requires each intermediate base to exist; replacing an outer object does not automatically duplicate nested objects.

Formal Syntax & Structure

javascript syntaxjavascript
record.child.field

Working Example

Example Snippetjavascript
const a={child:{n:2}};console.log(a.child.n);
JavaScript Reference