Records With Objects (Summary)

You started this course in front of a shelf of board games, wondering which ones would suit your friends and your evening. Since then, you’ve described one game as a record, kept a whole shelf of records in an array, and written functions that answer questions about it. You also built a program of your own from a brief and showed that you could explain, check, and change it.

This page collects those ideas in one place, so you can come back to it whenever you write a program with records. You practiced in the project, its review, and the quiz. Before you read the list below, take two minutes to pull the ideas out of memory once more.

Try It From Memory

Here’s a small shelf with three games. Each one has an id sticker, and a function named findGame() returns the record whose id field matches, just like the one you wrote for the shelf helper:

Language: JavaScript
const games = [
  { id: 2, title: "Azul", maxPlayers: 4, minutes: 45 },
  { id: 12, title: "Dixit", maxPlayers: 6, minutes: 30 },
  { id: 7, title: "Catan", maxPlayers: 4, minutes: 90 },
];

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.