🦁

Jungle Collection Ops

You've worked with arrays (lists of stuff) and functions (reusable recipes). Now combine them! Meet collection operations β€” super-tools that transform a WHOLE list in one move. Map changes every item. Filter keeps only the ones you want. Reduce squishes everything into one answer. Lead your jungle expedition!

← Code CP18 Creator Path 🦁 Jungle Collection Ops
🦁
Welcome to Jungle Explorer HQ! Your expedition team spotted a herd of animals. As lead explorer, you'll use code super-tools to organize them β€” transform their data, filter by traits, and count them up!
⚑ Today's Concept

Collection Operations: Map, Filter, Reduce

Instead of looping through a list one item at a time, programmers use three super-tools that operate on a whole collection instantly:

πŸ—ΊοΈ MAP β€” "Change every one." Give each animal a boost, rename them all, or convert their data. One rule, applied to all.
πŸ” FILTER β€” "Keep only the matches." Set a condition, keep only the animals that pass. The rest fade away.
βž• REDUCE β€” "Squish into one." Add up all weights, find the fastest, or count the herd. Many items β†’ one answer.

🐾 Your Jungle Collection 8 animals

8
Animals
0
Total kg
0
Top Speed
0
Mammals

πŸ› οΈ Pick Your Operation

πŸ—ΊοΈ Result

🎯 Challenges

0 of 5 challenges 0/5
πŸ†

Exedition Complete!

You mastered the three collection super-tools!

What You Learned

MAP transforms every item in a collection using one rule β€” no loop needed.
FILTER keeps only items that pass a condition you set.
REDUCE combines all items into a single value β€” a total, a max, or a count.
These are higher-order functions β€” functions that take a rule and apply it to a whole list.
Real apps use these everywhere: search, sorting, dashboards, scores.

🦁 Come back tomorrow! Next up: you'll chain these tools together β€” filter a herd, THEN map the survivors, THEN reduce to a score. That's how real data pipelines are built!