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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.