Lesson 14 of 18

📊 Arrays & Loops

🎯 Grades 9–12 ⏱ ~35 minutes 🟡 Intermediate

What You'll Learn

  • Array methods: map, filter, reduce, find, sort, forEach
  • Destructuring arrays and objects; the spread operator
  • Rendering dynamic lists of cards from data arrays
Quick Check

1. What does Array.map() do?

ARemoves elements matching a condition
BTransforms each element and returns a new array
CFinds the first matching element

2. Which method returns only elements where the callback returns true?

A.map()
B.filter()
C.forEach()

3. What does the spread operator ... do to an array?

ASorts the array
BExpands the array's elements (useful for copying/merging)
CRemoves duplicates

4. What does .reduce() return?

AAlways a number
BA single accumulated value (could be number, string, object, etc.)
CA filtered array