Lodash _.over() Method

Beginner
⏱️ 8 min read
📚 Updated: Jul 2026
🎯 6 Examples + 3 Try It
Util utilities

What You’ll Learn

By the end of this tutorial, you’ll use Lodash’s _.over() to run several functions on the same arguments and collect their results in one array.

01

Core Syntax

_.over([iteratees])

02

Same args

Every fn gets inputs.

03

Array out

Results in order.

04

Not flow

Parallel, not pipe.

05

Shorthands

Property strings OK.

06

vs overEvery

Array vs boolean.

What Is _.over()?

_.over(iteratees) builds a fan-out function. Call it once with any arguments; Lodash forwards those exact arguments to each iteratee and returns [result₁, result₂, …].

💡
Beginner tip — parallel views, not a pipeline

_.over([square, cube])(3) gives [9, 27]—both functions receive 3. That is different from _.flow([square, cube])(3), which would pipe 9 into cube. Do not confuse over with flow (the old reference did).

Use over when one input should produce several derived values—statistics, geometry metrics, or multiple property picks from the same object.

📝 Syntax

Pass an array of iteratees (functions or shorthands):

javascript
_.over([iteratees = [_.identity]])

Syntax Rules

  • iteratees — array of functions; defaults to [_.identity].
  • Return value — a new function that returns an array of iteratee results.
  • Same arguments — every iteratee receives the full argument list from the outer call.
  • Order preserved — result array matches iteratee order.
  • Shorthands — property strings and other Lodash iteratee forms work in the list.
javascript
import over from "lodash/over";



const minMax = over([Math.min, Math.max]);



minMax(1, 2, 3, 4);

// [1, 4]

⚡ Quick Reference

TaskCode patternNotes
Min + max_.over([Math.min, Math.max])(...n)Official example
Two transforms_.over([square, cube])(3)[9, 27]
Pick properties_.over(['name', 'age'])(user)Shorthand
With nthArg_.over([_.nthArg(0), _.nthArg(1)])Arg pickers
Default_.over()(x)[x] identity
Pipeline_.flow([f, g])Not over
Returns
Function

Fan-out fn

Output
Array

All results

Related
overEvery

All truthy

Category
Util

Function

🧰 Parameters

Arguments to _.over() and the combinator it returns:

iteratees Optional

Array of functions (or iteratee shorthands) to invoke. Defaults to [_.identity].

_.over([fn1, fn2])
returned fn Combinator

Variadic: forwards all received arguments to each iteratee.

combo(a, b, c)
result array Ordered

Index i holds the return value of iteratees[i].

[r0, r1, r2]
errors Propagates

If one iteratee throws, the whole call throws—there is no partial result array.

try / catch

For boolean “all pass” or “any pass” checks on predicates, use _.overEvery() or _.overSome() instead.

Examples Gallery

Practical _.over() patterns with copy-ready code, sample output, and interactive Try It Yourself labs.

📚 Getting Started

Official min/max pattern and basic transforms.

Example 1 — Min and max together

Lodash docs example with built-in Math.min and Math.max.

javascript
const minMax = _.over([Math.max, Math.min]);



console.log(minMax(1, 2, 3, 4));

// [4, 1]
Try It Yourself

How It Works

Both Math.max and Math.min receive (1, 2, 3, 4). Results are collected—order follows the iteratee array.

Example 2 — Square and cube of the same number

Classic beginner demo—two pure functions, one input.

javascript
const square = (n) => n * n;

const cube = (n) => n * n * n;



const powers = _.over([square, cube]);



console.log(powers(3));

// [9, 27]
Try It Yourself

How It Works

Each iteratee sees the same 3—no chaining between square and cube.

📈 Practical Patterns

Multi-argument metrics, property picks, and arg slots.

Example 3 — Rectangle area and perimeter

Two metrics from the same length and width—solid use case from the old tutorial, kept and clarified.

javascript
const area = (length, width) => length * width;

const perimeter = (length, width) => 2 * (length + width);



const rectangleMetrics = _.over([area, perimeter]);



console.log(rectangleMetrics(4, 6));

// [24, 20]

How It Works

Both functions receive (4, 6). Destructure the returned array as [area, perimeter] for readable call sites.

Example 4 — Pick multiple properties

Iteratee shorthands—each property name becomes a getter on the same object.

javascript
const user = { name: "Ada", age: 30, role: "admin" };



const pickFields = _.over(["name", "age"]);



console.log(pickFields(user));

// ["Ada", 30]

How It Works

Lodash converts each string to a property iteratee. Both run on the same user argument.

Example 5 — Combine with _.nthArg

Extract the first and second arguments from one variadic call.

javascript
const pickFirstAndSecond = _.over([_.nthArg(0), _.nthArg(1)]);



console.log(pickFirstAndSecond("apple", "banana", "cherry"));

// ["apple", "banana"]
Try It Yourself

How It Works

Natural pairing from the nthArg tutorial—over collects what each picker returns.

🚀 Beyond the Basics

over vs flow—and when predicates belong elsewhere.

Example 6 — over vs _.flow (fixing a common mistake)

Same iteratees, different combinators—very different results.

javascript
const inc = (n) => n + 1;

const dbl = (n) => n * 2;



console.log(_.over([inc, dbl])(3));

// [4, 6] — both get 3



console.log(_.flow([inc, dbl])(3));

// 8 — inc(3)=4, then dbl(4)=8

How It Works

The old reference suggested _.flow for an “over-style pipeline”—that is sequential composition. Use _.over when you want every result, not the final piped value.

🧠 How _.over() Works

1

Normalize iteratees

Lodash converts shorthands to functions and defaults to [_.identity].

Setup
2

Return combinator

The new function waits for arguments from your call site.

Factory
3

Fan-out invoke

Each iteratee runs with the same argument list; results push into an array.

Execute
=

Result array

Ordered values—one slot per iteratee.

📝 Notes

  • _.over is parallel fan-out—not sequential like _.flow().
  • Result order matches iteratee order—document which index means what.
  • Default iteratees [_.identity] wrap a single value: _.over()(x)[x].
  • If any iteratee throws, the entire combinator throws—wrap risky iteratees if needed.
  • For “all predicates true” use overEvery; for “any true” use overSome.
  • Next in the series: _.overEvery()—boolean all-check combinator.

Conclusion

_.over() runs several iteratees on the same arguments and hands back every result in one array—ideal for multi-metric helpers and multi-field picks.

Keep it separate from _.flow (pipe) and from predicate combinators (overEvery / overSome). Choose the combinator that matches the shape of answer you need.

💡 Best Practices

✅ Do

  • Destructure results: const [max, min] = minMax(...args)
  • Keep iteratees pure when possible—same args, predictable outputs
  • Use property shorthands for simple field extraction
  • Pair with _.nthArg for variadic arg slots
  • Use _.flow when output should feed the next step

❌ Don’t

  • Replace pipelines with over—use flow for sequences
  • Expect short-circuiting—every iteratee always runs
  • Use over when you only need a boolean—use overEvery/overSome
  • Pass unrelated iteratees without documenting index meaning
  • Assume parallel means async—over is synchronous unless iteratees are async

Key Takeaways

Knowledge Unlocked

Five things to remember about _.over()

Use these points when fanning out to multiple iteratees.

5
Core concepts
🗃 02

Array

All results.

Output
🔄 03

Not flow

No piping.

Compare
📝 04

Shorthands

Property picks.

Iteratee
🛠 05

overEvery

Predicates next.

Related

❓ Frequently Asked Questions

_.over(iteratees) returns a new function. When you call it with arguments, Lodash runs every iteratee with those same arguments and returns an array of each result—in order.
No. _.over runs all iteratees on the same inputs in parallel and returns [result1, result2, ...]. _.flow pipes output of one function into the next. The old tutorial wrongly used flow for an 'over pipeline'—use flow for sequences, over for multiple views of the same args.
Lodash defaults to [_.identity]—_.over()(value) returns [value].
Pass an array: _.over([fn1, fn2]). You can also use iteratee shorthands (property strings, matches objects) like other Lodash APIs—each shorthand becomes a function in the list.
_.over collects every result in an array. _.overEvery returns true only if all predicates are truthy. _.overSome returns true if any predicate is truthy.
Use it when one input should produce several derived values at once—min and max together, area and perimeter, or multiple property picks from the same object.
Did you know?

The official Lodash example uses Math.max and Math.min because both are variadic—_.over([Math.max, Math.min])(1,2,3,4) returns [4, 1] without writing custom min/max wrappers.

Practice _.over() in the Live Editor

Run min/max, square/cube, and nthArg pickers on the same arguments.

Open Try It editor →

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.

6 people found this page helpful