liveBook · Manning

Accessor descriptor

Also called accessor properties

An accessor descriptor defines an object property whose value is read or changed through getter and setter functions rather than directly stored.

How 2 Manning books explain it

JavaScript in Depth

A JavaScript property whose getter or setter code runs when the property is read or written instead of directly storing and retrieving a value.

How it is used
Explains computed property access, hidden mutation, and confusing assignment behavior in JavaScript objects and classes.
How deep it goes
Descends from getter and setter intuition to descriptor attributes and prototype placement, but not engine implementation.
Examples
Uses a computed drawer, `Object.defineProperty()`, descriptor inspection, and class accessors to expose runtime behavior.
What you can do after
Diagnose/debug with it by inspecting descriptors and distinguishing computed access from stored values.

Read how JavaScript in Depth explains accessor descriptor →

Secrets of the JavaScript Ninja, Third Edition

An object property whose value is accessed through getter or setter behavior rather than a directly stored value.

How it is used
Defines properties that run getter or setter functions when accessed or assigned.
How deep it goes
Explains getter and setter behavior, descriptor defaults, and assignment or deletion effects.
Examples
Demonstrates a firstNinja property that reads from and writes to an array, plus read-only and write-only properties.
What you can do after
Apply accessor behavior with Object.defineProperty or getter and setter syntax.

Read how Secrets of the JavaScript Ninja, Third Edition explains accessor descriptor →

Related concepts

Questions about accessor descriptor

What is accessor descriptor?

An accessor descriptor defines an object property whose value is read or changed through getter and setter functions rather than directly stored.

Which Manning books explain accessor descriptor?

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

What should I know before learning accessor descriptor?

Manning books that teach accessor descriptor usually introduce for...in first.

What is the difference between accessor descriptor and data property?

An accessor descriptor defines an object property whose value is read or changed through getter and setter functions rather than directly stored. A data property is an object property that stores a value directly rather than computing it through an accessor.

What is accessor descriptor a kind of?

Accessor descriptor is a kind of attribute. An attribute is a named property or piece of information associated with an entity, object, or structured data item.

What is accessor descriptor also called?

Accessor descriptor is also called accessor properties.

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.