The pipe operator forwards a value through functions from left to right, so each operation receives the previous operation’s output. It makes function pipelines read in the same direction as data flow, avoiding compose’s reverse order and supporting declarative, point-free JavaScript. section 4.8 section 1.3
Use the pipe model to organize composable operations:
- Decompose complex behavior into small functions, then connect their outputs into a readable information pipeline. section 1.1 section 4.0
- Prefer pipe when execution should read naturally from the initial value toward the final result; use compose when right-to-left flow is acceptable. section 4.8
- Treat |> as native pipeline syntax that removes the need for combinator helpers, while recognizing its described status as a future JavaScript feature. section 4.8 section 1.1
A left-to-right transformation
The expression '1 2 3' |> split |> count first splits the string and then counts the resulting array, producing 3. A final lambda can continue the chain: '1 2 3' |> split |> count |> (x => x ** 2) produces 9. section 1.3 section 4.8
ledger
|> Array.from
|> filter(b => (b |> prop('isGenesis') |> not))
|> flatMap(prop('data'))
|> map(balanceOf(address))
|> reduce(Money.sum, Money.zero())
|> Money.round;
Inspect a longer ledger pipeline that converts data, filters records, maps balances, reduces totals, and rounds the result. section 4.8





