Lodash _.flowRight() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Util

Definition

Like _.flow, but invokes the given functions from right to left (compose style). Part of Lodash Util since 3.0.0 (stable — not deprecated).

Note: Only the rightmost function receives all outer arguments. Steps to its left get one value — the previous return.

Syntax

Call _.flowRight. Start with this line.

Lodash
_.flowRight([funcs]) or _.flowRight(f, g, …)
CallWhat it does
_.flowRight([funcs]) or _.flowRight(f, g, …)Primary signature.
_.flowRight(...)Call the util helper.

Prefer import flowRight from "lodash/flowRight" when you want a smaller bundle.

Library declarations
Lodash
_.flowRight([funcs]) or _.flowRight(f, g, …)

Parameters

ParameterDescription
funcsOptional. Functions to invoke (array and/or rest args)

Return Value

Return ValueDescription
*New composite function

Lodash Examples

Example 1 — Official: Add, Then Square

List square then _.add — runtime still runs add first.

Lodash
function square(n) {
  return n * n;
}

var addSquare = _.flowRight([square, _.add]);
addSquare(1, 2);
// → 9
Try It Yourself

How It Works

  1. List. Array is [square, _.add] left to right.
  2. Run right first. _.add(1, 2) → 3.
  3. Then left. square(3) → 9.
  4. Match flow. Same as _.flow([_.add, square])(1, 2).

Example 2 — Variadic Form

Same compose without wrapping functions in an array.

Lodash
function square(n) {
  return n * n;
}

var addSquare = _.flowRight(square, _.add);
addSquare(1, 2);
// → 9
Try It Yourself

How It Works

  1. Rest args. square, then _.add on the right.
  2. Same as array. Equivalent to _.flowRight([square, _.add]).
  3. Result. Still 9 for (1, 2).
  4. Style. Use whichever reads clearer.

Example 3 — String Compose

Rightmost runs first: trim, then uppercase.

Lodash
var clean = _.flowRight(_.toUpper, _.trim);

clean("  hello  ");
// → "HELLO"
Try It Yourself

How It Works

  1. Right first. _.trim(" hello ") → "hello".
  2. Then left. _.toUpper("hello") → "HELLO".
  3. Compose reading. Final step appears on the left.
  4. vs flow. _.flow(_.trim, _.toUpper) lists steps in run order.

Example 4 — flowRight vs flow

Same unary list — opposite invoke order and different results.

Lodash
function addOne(n) {
  return n + 1;
}
function double(n) {
  return n * 2;
}

_.flowRight(addOne, double)(3);
// → 7   // (3 * 2) + 1

_.flow(addOne, double)(3);
// → 8   // (3 + 1) * 2
Try It Yourself

How It Works

  1. flowRight. Right→left: double → addOne → 7.
  2. flow. Left→right: addOne → double → 8.
  3. Same names. Order alone changes the math.
  4. Pick. Compose notation → flowRight; pipeline reading → flow.

Example 5 — Multi-Arg Rightmost Step

Extra arguments reach only the function that runs first (rightmost).

Lodash
function joinPair(a, b) {
  return a + "-" + b;
}

var shout = _.flowRight(_.toUpper, joinPair);
shout("hi", "there");
// → "HI-THERE"
Try It Yourself

How It Works

  1. Rightmost. joinPair("hi", "there") → "hi-there".
  2. Then left. _.toUpper receives that one string.
  3. Rule. Leftward steps must be unary.
  4. Tip. Need more args later? Use _.partial.

Browser & Runtime Support

_.flowRight is a Lodash Util helper since 3.0.0. It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 3.0.0+

_.flowRight()

Available in [email protected] full builds and the lodash/flowRight modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 3.0+
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.flowRight Lodash 3.0.0+

Bottom line: Safe for production once Lodash is loaded. Prefer import flowRight from "lodash/flowRight" for smaller bundles. Use it when compose (right-to-left) reading matches how you think about the transform.

Frequently Asked Questions

_.flowRight(...funcs) returns a new function that runs the listed functions from right to left. Official: _.flowRight([square, _.add])(1, 2) → 9 (add first, then square).
As an array (_.flowRight([f, g])) or as separate arguments (_.flowRight(f, g)). Both forms work in Lodash 4.
Only the rightmost function — the one that runs first. Later (leftward) steps receive one value, the previous return.
flowRight is right → left (compose style). flow is left → right (pipeline style). Same helpers in reverse list order can match.
When you think in mathematical compose — innermost transform first — or when listing the final step on the left feels natural.
Use import flowRight from "lodash/flowRight" or require("lodash/flowRight"). Full build: import _ from "lodash" then _.flowRight.

Next: _.identity()

Return the first argument unchanged — a no-op building block.

_.identity() tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful