Mapping behavior

In imperative code, you have things, such as if statements, that determine what happens next. Taken in moderation, there's nothing wrong with this type of construct. But when your main avenue of logic is imperative statements, things tend to grow unmaintainable quickly.

The alternative to this imperative style is to compose your logic declaratively. Maps are the first tool that will help you get there.

Get Mastering Immutable.js now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.