Skip to main content
Module 3 · Lesson 2 of 410/32 in the course~16 min
Module lessons (2/4)

Objects: the key-value map

Lesson preview5 hands-on exercises readyJavaScript Course · Module 3 — Arrays and objects

Literals, dot and bracket access, adding/removing properties.

What you'll learn in this lesson

  • Model domain entities as key → value dictionaries with object literals.
  • Choose correctly between dot notation (user.name) and bracket notation (user[fieldName]).
  • Use property shorthand ({ name, age }) and read optional keys securely with ?..
  • Test for the existence of a key with Object.hasOwn(obj, key) by distinguishing it from a value undefined.

Overview

An object represents a structured record of properties chiave → valore. Almost every JSON API, configuration, or state in JavaScript travels as an object — but because objects live in the Heap by reference, changing their properties affects anyone who shares their address.

Sections covered in this lesson

  1. 1Mental model: access and ownership control
  2. 2Progressive examples
  3. 3Guided laboratory
  4. 4Check for understanding
Pro Lesson · Module 3 — Arrays and objects

Unlock "Objects: the key-value map" and the full JavaScript Course curriculum

Literals, dot and bracket access, adding/removing properties.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in JavaScript Course plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.