liveBook · Manning

Join

As explained in Functional Programming in JavaScript

A monadic operation that removes one layer of nesting from a monadic structure.

join flattens nested monadic values into a single layer. It matters when composing monad-returning functions produces wrappers inside wrappers. section 5.3

With Wrapper, join recursively peels away inner Wrapper layers, like peeling an onion. The same idea is compared to flattening arrays. section 5.3

Nested Wrapper collapsed

Wrapper.of(Wrapper.of(Wrapper.of('Get Functional'))).join() returns Wrapper('Get Functional').

How Functional Programming in JavaScript covers it

How deep it goes
Defines join by example and shows recursive flattening, but stops short of formal laws or broader monad API details.
Examples
Uses nested Wrapper values, composed student lookup, and an array flatten analogy.
What it assumes
Assumes familiarity with Wrapper, map, and composition, while introducing join from the ground up.
What you can do after
Operate nested monadic results by collapsing them into one layer for further access.
How it connects
Connects to Wrapper, map, bind, monads, and flattening arrays.

Also explained in

Compare how 3 books explain join →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Functional Programming in JavaScript. The section links point to the parts of the book it draws on.