Lodash _(value) Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Seq

Definition

Creates a Lodash wrapper around value to enable implicit method chain sequences. Some results auto-unwrap; others need .value(). Part of Lodash 4.x Seq (the main _ function).

Pass the value you want to wrap or transform. Finish with .value() when the result stays wrapped.

Syntax

Call _(value). Start with this line.

Lodash
_(value)
CallWhat it does
_(value)Primary signature.

Prefer import _ from "lodash" (full build) when you need wrapping and chaining.

Library declarations
Lodash
_(value)

Parameters

ParameterDescription
valueRequired. Value to wrap

Return Value

Return ValueDescription
*Lodash wrapper (implicit chain)

Lodash Examples

Example 1 — Official: reduce vs map

Show auto-unwrap versus a wrapped collection.

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

var wrapped = _([1, 2, 3]);

wrapped.reduce(_.add);
// → 6

var squares = wrapped.map(square);
_.isArray(squares);
// → false

_.isArray(squares.value());
// → true
Try It Yourself

How It Works

  1. Wrap. _([1, 2, 3]) starts an implicit sequence.
  2. reduce. Single-value result → auto-unwraps to 6.
  3. map. Collection result → stays a wrapper.
  4. value. squares.value() is a real array.

Example 2 — map + filter + value

Collection steps need an explicit unwrap at the end.

Lodash
_([1, 2, 3, 4])
  .map(function (n) { return n * 2; })
  .filter(function (n) { return n > 5; })
  .value();
// → [6, 8]
Try It Yourself

How It Works

  1. map. Doubles → wrapped [2, 4, 6, 8].
  2. filter. Keeps values > 5 — still wrapped.
  3. value. Unwraps to a plain array.
  4. Pattern. Typical short pipeline with _().

Example 3 — Implicit head

Single-value methods often end the chain for you.

Lodash
_([10, 20, 30]).head();
// → 10

_([10, 20, 30]).map(function (n) { return n + 1; }).head();
// → 11
Try It Yourself

How It Works

  1. head. Returns one element → auto-unwrap.
  2. map then head. Map stays wrapped; head ends it.
  3. Result. Plain numbers, no .value() needed.
  4. Contrast. With _.chain, head would still need .value().

Example 4 — vs _.chain

Same start, different unwrap rules.

Lodash
_([1, 2, 3]).head();
// → 1

_.chain([1, 2, 3]).head().value();
// → 1

typeof _.chain([1, 2, 3]).head().value;
// → "function"   // still a wrapper before .value()
Try It Yourself

How It Works

  1. _(). Implicit — head returns 1.
  2. chain. Explicit — must call .value().
  3. Check. Before unwrap, chain’s head is still a wrapper.
  4. Choose. Prefer _() for short flows; _.chain when every step must stay chainable.

Example 5 — Inspect with tap

Side-effect mid-pipeline without changing the value.

Lodash
var seen = null;

_([1, 2, 3])
  .map(function (n) { return n * 2; })
  .tap(function (arr) { seen = arr.slice(); })
  .filter(function (n) { return n > 2; })
  .value();
// → [4, 6]

seen;
// → [2, 4, 6]
Try It Yourself

How It Works

  1. map. Doubles the numbers.
  2. tap. Snapshot for debugging; value passes through.
  3. filter + value. Finish the pipeline.
  4. More. See _.tap and _.thru.

Browser & Runtime Support

_(value) is the main Lodash 4.x entry point (Seq/wrapper). It runs anywhere full Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash. There is no native Lodash-style wrapper — use nested calls or array methods instead.

✓ Stable · Lodash 4.x

_(value)

Available as the default lodash export and via CDN. Wrapper chaining expects a full Lodash build. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 4.x
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
_(value) Lodash 4.x full

Bottom line: Safe for production with full Lodash. Prefer _(value) for short implicit pipelines; use _.chain when you need explicit unwrap control.

Frequently Asked Questions

It wraps value in a Lodash instance so you can call Lodash methods fluently. Official: _([1,2,3]).reduce(_.add) → 6 (auto-unwrapped).
Methods that return a single/primitive-like result (reduce, head, sum, …) end the implicit chain. Methods that return arrays/collections (map, filter, …) stay wrapped.
_(value) uses implicit chaining. _.chain(value) forces explicit chaining — you must call .value() yourself.
Yes when the last method stays wrapped (e.g. map). Use .value() to get a plain array/object.
Lodash defers work until unwrap (implicit or .value()). Shortcut fusion may merge some iteratee steps on arrays.
No. Mutation depends on later methods you call (e.g. reverse may mutate).

Next: Wrapper Prototype

Explore .value(), .commit(), .plant(), and other wrapper methods.

Wrapper prototype →

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.

9 people found this page helpful