JavaScript objects

JavaScript objects and object methods

Learn JavaScript objects with focused lessons on properties, references, copying, methods, this, constructors, optional chaining, property descriptors, getters, setters, prototypes, destructuring, and JSON.

Object lessons and concepts

  1. Object basics

    Create object literals, store related values as properties, and use objects to model structured application data.

    Outcome: Represent users, products, settings, records, and other named data.

    • JavaScript objects
    • object properties
    • object literal
    Study Objects
  2. References and copying

    Understand object references, shared mutation, shallow copies, and how object assignment differs from primitive assignment.

    Outcome: Avoid accidental mutation when passing or copying object data.

    • object reference
    • copy object JavaScript
    • shallow copy
    Study Object references and copying
  3. Object methods and this

    Attach behavior to objects with methods and understand how this is resolved when methods are called.

    Outcome: Write object methods that read and update the correct object state.

    • object methods
    • this JavaScript
    • method call
    Study Object methods, "this"
  4. Constructors and new

    Create repeated object shapes with constructor functions and understand how new initializes object instances.

    Outcome: Build consistent object instances before moving into classes and prototypes.

    • JavaScript constructor
    • new operator
    • object instance
    Study Constructor, operator "new"
  5. Optional chaining

    Read nested object properties safely when data may be missing or partially loaded.

    Outcome: Handle API-shaped objects without defensive property checks everywhere.

    • optional chaining
    • nested objects
    • safe property access
    Study Optional chaining '?.'
  6. Object to primitive conversion

    Learn how objects convert to primitive values in string, number, comparison, and arithmetic contexts.

    Outcome: Predict object behavior in expressions that expect primitive values.

    • object to primitive
    • Symbol.toPrimitive
    • valueOf toString
    Study Object to primitive conversion
  7. Object keys, values, and entries

    Convert object properties into iterable lists so array methods can transform records and dictionaries.

    Outcome: Bridge object records with array workflows such as map, filter, and reduce.

    • Object.keys
    • Object.values
    • Object.entries
    Study Object.keys, values, entries
  8. Property flags and descriptors

    Inspect and control writable, enumerable, and configurable flags for advanced object property behavior.

    Outcome: Understand why some object properties can be hidden, locked, or protected.

    • property descriptors
    • Object.defineProperty
    • enumerable
    Study Property flags and descriptors
  9. Getters and setters

    Use accessor properties to compute values, validate assignments, and expose a cleaner object interface.

    Outcome: Design object APIs that feel like properties while running controlled logic.

    • JavaScript getters
    • JavaScript setters
    • accessor properties
    Study Property getters and setters
  10. Prototype inheritance

    Follow the prototype chain and understand how objects inherit behavior from other objects.

    Outcome: Connect object basics to prototypes, classes, and inherited methods.

    • prototype inheritance
    • prototype chain
    • prototypal inheritance
    Study Prototypal inheritance
  11. Destructuring objects

    Extract object properties with destructuring patterns, defaults, aliases, rest properties, and nested bindings.

    Outcome: Read object data clearly in functions, modules, and data transformations.

    • object destructuring
    • destructuring assignment
    • rest properties
    Study Destructuring assignment
  12. JSON objects

    Serialize objects to JSON, parse JSON objects from APIs, and prepare data for storage or network boundaries.

    Outcome: Move object-shaped data between JavaScript, APIs, files, and storage.

    • JSON objects
    • JSON parse
    • JSON stringify
    Study JSON methods, toJSON