# Objects: properties, prototypes and descriptors

*JavaScript Developer Study Guide · Objects, Functions, and Classes · Last updated October 16, 2026 · https://www.certifyforce.com/study-guide/javascript-developer/objects-functions-and-classes/objects-properties-prototypes-and-descriptors*

How object literals, bracket and dot access, copies, the prototype chain and property descriptors behave, so you can pick the object technique a requirement needs and predict what keys, lookups, freeze and seal do.

- Certification: Salesforce JavaScript Developer
- Exam section: Objects, Functions, and Classes
- Study guide: https://www.certifyforce.com/study-guide/javascript-developer

**Official exam objective:**

> Given a business requirement, apply fundamentals of object implementation to solve the business requirement.

## What the exam expects

- Read and write properties with dot and bracket notation, computed keys, shorthand properties, methods and getters/setters, and predict the result.
- Merge or copy objects without mutating a shared source, and know that every built-in copy is shallow.
- Put shared behaviour on a prototype (`Object.create`, constructor `prototype`) and predict lookups, shadowing and `delete` along the prototype chain.
- Choose `Object.freeze`, `Object.seal`, `Object.preventExtensions` or `Object.defineProperty` from a mutability requirement, and read property descriptors.
- Tell own from inherited and enumerable from hidden properties with `in`, `Object.hasOwn`, `Object.keys`/`entries` and `for...in`.
- Key terms: **own property** (defined on the object itself, not inherited); **prototype** (the object a failed lookup continues to); **property descriptor** (a property's `value`, `writable`, `enumerable`, `configurable`, or `get`/`set`); **enumerable** (shows up in `Object.keys` and `for...in`); **shallow copy** (new outer object, same nested objects).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Bracket required | Names with spaces or hyphens, starting with a digit, or held in a variable | [Working with objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_objects) |
| Object as key | Coerced to the string `"[object Object]"` | [Property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) |
| Object comparison | By reference; distinct objects are never equal | [Working with objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_objects) |
| Merge order | Later sources overwrite earlier ones; the first argument is mutated | [Object.assign()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) |
| Spread copy | Shallow; skips non-enumerable properties and the prototype | [Spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) |
| `delete` and inheritance | Removes only own properties; the inherited value reappears | [delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete) |
| `in` | Searches the object and its prototype chain | [in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in) |
| `Object.hasOwn` | Own properties only; replaces `hasOwnProperty` | [Object.hasOwn()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn) |
| `for...in` | Own and inherited enumerable string keys | [for...in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) |
| `defineProperty` defaults | `writable`, `enumerable`, `configurable` default to `false` when the property is new | [Object.defineProperty()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty) |
| Seal | No add or delete; writable values still change | [Object.seal()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) |
| Freeze | No add, delete or change; shallow; failed changes usually throw in strict mode and are otherwise ignored silently | [Object.freeze()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) |

## Check yourself

- Why does a memo cache keyed by two different customer objects end up with one entry?
- When does `Object.assign` change the shared defaults object?
- Why do instances share a method defined on `Constructor.prototype` but not one assigned in the constructor?
- Which check returns true for an own property whose value is `undefined` but false for an inherited one?
- What does `delete` do when the same name also exists on the prototype?

## Sources

- [Working with objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_objects)
- [Inheritance and the prototype chain](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain)
- [Object initializer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer)
- [Property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors)
- [Object.defineProperty()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty)
- [Object.freeze()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)
- [Object.seal()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)
- [Object.preventExtensions()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)
- [Object.create()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)
- [Object.assign()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
- [Spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax)
- [Object.hasOwn()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn)
- [in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in)
- [for...in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in)
- [delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete)
- [Object.entries()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries)
- [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 15 linked practice questions, and unlimited timed mock exams are included with the JavaScript Developer pack (USD $19): https://www.certifyforce.com/practice-exams
