Lesson 3 of 8

Objects and data

Goal

Render a list of objects

01

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.

02

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
  1. Three cards with the class card
  2. Each card has an h3 and a p
  3. The names are in the h3 elements
  4. The roles are in the p elements
03

Hints

0/3
Track lessons0 of 8 done

Work with data, functions and operations that take time, and build up to an interface that creates its elements from data.

Intermediate level, 8 lessons, 2 hours in total.

index.html
Preview
index.html100%
–/4

Press “Run and check” to grade your code.

4 checks listed under “Your task”.

Track lessons0 of 8 done

Work with data, functions and operations that take time, and build up to an interface that creates its elements from data.

Intermediate level, 8 lessons, 2 hours in total.