JavaScript for Real

Lesson 3 · zap JavaScript for Real

Arrays & Objects, Fluently

Transform data with map/filter/reduce instead of loops.

Before you start

Most application code is reshaping data. map transforms each item, filter keeps some, reduce collapses to one value. Chaining them reads like a description of intent, which is why it survives code review better than a nested loop.

5 exercises·up to 100 XP·5/5 hearts