JavaScript Foundations·Practice drills 13

Drill 20: List the steps — Arrays and objects

List the steps the code follows in order.

Beginner 5 min read Lesson 323 of 480 Challenge included
What you will be able to do
  • List the steps the code follows in order.

Practice task

List the steps the code follows in order.

arrays.jsJavaScript
const lessons = [
  { title: "Variables", done: true, minutes: 10 },
  { title: "Functions", done: true, minutes: 12 },
  { title: "Arrays", done: false, minutes: 14 },
];

const finished = lessons.filter((lesson) => lesson.done);
const titles = lessons.map((lesson) => lesson.title);
const totalMinutes = lessons.reduce((sum, lesson) => sum + lesson.minutes, 0);

const { title } = lessons[2];
console.log(titles, totalMinutes, title);
Your turn

Write your answer

Easy

List the steps the code follows in order.

TEXT · starter
Your answer…
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Lesson 323 of 480 · 0% of course