Objects
An object groups related values under names called properties: let pet = { name: "Milo", age: 3 };
Read a property with a dot: pet.name is "Milo". Change one the same way: pet.age = 4;
Objects and arrays work together. A list of products is an array of objects, and that's how most real app data looks.
Example
let book = { title: "Wonder", pages: 310, read: false };
book.read = true;
console.log(book.title + " has " + book.pages + " pages");
console.log("Finished?", book.read);
Separate properties with commas, and don't forget the colon between each name and its value.
Your tasks
0 of 3 done- student has a name and a numeric age
- describe({ name: "Asha", age: 14 }) returns "Asha is 14 years old"Expected "Asha is 14 years old", got undefined
- describe works for anyoneExpected "Leo is 9 years old", got undefined
Tutor
The tutor guides you toward the answer instead of handing it over. It uses your own Claude usage.
Quick check
Given let car = { color: "red" }, how do you read the color?
undefined
No problems found. Unclosed tags, missing semicolons and errors show up here in plain words.