Example 1 — Official Math.sqrt Pipeline
Take the square root, flip the sign, then add one — the sample from the Ramda docs.
const result = R.flow(9, [Math.sqrt, R.negate, R.inc]);
console.log(result); // -2 How It Works
- Seed.
9goes into the first step. - Step 1.
Math.sqrt(9)→3. - Step 2.
R.negate(3)→-3. - Step 3.
R.inc(-3)→-2, whichR.flowreturns.
