Skip to content
Learn Netverks

Lesson

Step 11/36 31% through track

objects-basics

Objects basics

Last reviewed Jun 1, 2026 Content v20260601
Track mode
client_javascript
Means
In-browser JS
Reading
~1 min
Level
beginner

This lesson

This lesson teaches Objects basics—the ideas, syntax, and habits you need before moving on in JavaScript.

Without a solid grasp of Objects basics, you will repeat mistakes in JavaScript exercises and on real pages or scripts.

You will apply Objects basics in contexts like: Browsers, Node.js services, edge workers, and tooling ecosystems (bundlers, test runners).

Run JavaScript in the in-browser sandbox, use the terminal output panel, and verify with MCQs.

When the previous lesson's MCQs feel easy and you can explain Objects basics in your own words.

Objects group named properties—records, config, DOM nodes, and API payloads are all objects.

Syntax

  • Literal: { id: 1, name: 'Ada' }
  • Access: user.name or user['name']
  • Optional chaining: user?.profile?.city

Spread

{ ...defaults, ...overrides } shallow-merges objects—common for props and config.

Important interview questions and answers

  1. Q: Shallow merge?
    A: Spread copies top-level keys; nested objects still shared.
  2. Q: Optional chaining?
    A: Short-circuits to undefined if intermediate is null/undefined.

Self-check

  1. Dot vs bracket access?
  2. When use optional chaining?

Tip: Re-run the playground code for objects-basics and tweak one line before the MCQs.

Interview prep

Optional chaining?

Safe access when intermediate may be null.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What would you log to verify this behavior?
  • What breaks if you run this before the DOM is ready?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump