Lesson 3 of 8
Objects and data
- 14 min
- 4 checks
- 3 hints
- Go to task
Goal
Render a list of objects
Explanation
An array stores values in order, while an object stores values that each have a name, like { name: 'Layan', role: 'Designer' }, and you reach any value by its name: person.name.
The data shape you'll see most often at work is an array of objects, because most APIs return their data that way.
Since the objects all have the same keys, you can write the card template once and fill it in from each object, so the whole interface is built from the data.
Your task
Show a card with the class card for each team member, with their name in an <h3> and their role in a <p>.
Checks
4 checks- Three cards with the class card
- Each card has an h3 and a p
- The names are in the h3 elements
- The roles are in the p elements