>_BeginnerCoder
Donate

Lesson 6 — Objects

Objects

An object groups related data as key: value pairs inside curly braces, and you read a value with a dot: user.name. It describes one thing with many properties.

Why it matters: objects model real-world items — a user, a product, settings — and are the shape of almost all web data (JSON).

Tip: you can also read a property with brackets, user["name"], handy when the key is in a variable.

Task

Add age and log a sentence.

← Back
Next →

Enjoying this lesson? Share it 👇

Keep going with JavaScript Foundations

Ready for more? These paid resources pick up where this lesson leaves off.

Some links on this page are affiliate links: we may earn a commission at no extra cost to you. We only recommend tools we believe are genuinely useful.