CodingNeed.

4 · Build useful programs · 8 MIN

Describe a real thing

Objects group related properties.

An object has named properties rather than numbered positions. Use dot notation for known names. A missing property gives undefined, so a program that accepts external data should validate required fields. In this exercise the supplied objects follow the described contract.

A contact card groups a name and age into one record.

Read the example

const learner = { name: "Ada", points: 50 };
console.log(learner.name);
Check the expected output
Ada

Your challenge

Return "NAME has POINTS points" using input.name and input.points.

Common trap

input.name and input["name"] work; input[name] looks up the value of a variable called name.

Next lesson: Project · Expense summary