By the end of this guide, you’ll know which wrapper prototype methods finish, extend, or clone a Lodash chain—and when to use each.
01
Not _.prototype()
Methods on the wrapper object.
02
.value()
Unwrap to plain data.
03
.commit()
Eager run, keep wrapper.
04
.plant()
Clone chain, new value.
05
.next() / .reverse()
Iterate or mutate in chain.
06
Method index
Links to each deep-dive tutorial.
Fundamentals
What Is the Wrapper Prototype?
When you call _.chain(value) or _(value), Lodash returns a wrapper object—not plain data. That wrapper exposes chainable Lodash methods (map, filter, etc.) and special prototype methods that control the pipeline itself: .value(), .commit(), .plant(), and others.
💡
Common misconception
There is no callable _.prototype() function in Lodash. “Wrapper prototype” means the methods attached to the sequence wrapper—documented under /lodash/seq/prototype/... on this site.
Think of wrapper prototype methods as the steering wheel of a chain: collection helpers move the data; prototype helpers decide when to unwrap, re-run, clone, or iterate the wrapper itself.
Foundation
📝 Syntax
Prototype methods are called on the wrapper returned by a chain entry point:
javascript
_(value)
.map(/* ... */)
.filter(/* ... */)
.value(); // unwrap — most common finish
// Other prototype methods:
.commit(); // run pending steps, return wrapper
.plant(newValue);
.next();
.reverse();
Syntax Rules
Call on wrapper — prototype methods are .value() style, not _.value() namespace calls.
.value() / .valueOf() — aliases; both unwrap and return plain JavaScript data.
.commit() — executes queued actions but returns another wrapper for hybrid chaining.
.plant(value) — clones the chain state with a different wrapped value.
Chain first — start with _(value) or _.chain(value), then call collection methods, then a prototype method.
javascript
import _ from "lodash";
const result = _([1, 2, 3, 4, 5])
.map(function (x) { return x * 2; })
.filter(function (x) { return x > 5; })
.value();
// result -> [6, 8, 10]
Cheat Sheet
⚡ Quick Reference
Task
Code pattern
Result
Unwrap result
.value()
Plain JS value
Eager + keep wrapper
.commit()
Wrapper (hybrid chains)
Clone with new data
.plant(value)
New wrapper
Lazy step
.next()
Iterator advance
Reverse in place
.reverse()
Wrapper (mutates array)
Alias unwrap
.valueOf()
Same as .value()
Unwrap
.value()
Most common
Hybrid
.commit()
Run + re-chain
Clone
.plant(x)
New wrapped value
Reference
🧰 Parameters
Core wrapper prototype methods and what each returns:
.value()Essential
Executes the chain and returns the unwrapped plain result. Alias: .valueOf().
_(data).map(...).value()
.commit()Hybrid
Runs pending actions eagerly but returns the wrapper so you can keep chaining.
.map(...).commit().filter(...)
.plant(value)Clone
Creates a chain clone at the same stage with a different wrapped value.
.map(...).plant(otherData)
.next() / .reverse()Advanced
.next() advances lazy iteration; .reverse() mutates the wrapped array in place.
.reverse().value()
Individual tutorials: /lodash/seq/prototype/{method} (for example /lodash/seq/prototype/value).
Hands-On
Examples Gallery
Practical wrapper prototype patterns with sample output and interactive Try It Yourself labs.
📚 Getting Started
Unwrap with .value() and .valueOf()—the methods you use most.
Collection methods (map, filter, etc.) add steps; the wrapper still holds deferred work until unwrap.
Pipeline
3
Control with prototype
Call .value() to finish, .commit() to run eagerly and continue, or .plant() to clone the chain.
Prototype
=
📦
Plain result or next wrapper
Most code ends with .value(). Advanced flows use .commit() or .plant() before more steps.
Important
📝 Notes
There is no_.prototype() function—prototype methods are called on the wrapper (.value(), not _.value()).
.value() and .valueOf() are aliases—both unwrap the chain.
.commit() is rarely needed in everyday code; reach for it when mixing wrapper and plain Lodash in one pipeline.
.reverse() mutates the wrapped array in place, like native Array.prototype.reverse.
.next() is for iterator-style lazy sequences—most beginners only need .value().
Deep dives live at /lodash/seq/prototype/value, .../commit, etc.
Wrap Up
Conclusion
Wrapper prototype methods are how you steer a Lodash chain: unwrap with .value(), run eagerly with .commit(), clone with .plant(), or handle advanced iteration with .next() and .reverse().
Default to .value() at the end of every chain in application code
Learn .commit() only when you hit hybrid chaining scenarios
Use .plant() to reuse a pipeline template across datasets
Read individual tutorials for .next() and .reverse() before using them
Annotate TypeScript types after .value(), not on the wrapper
❌ Don’t
Search for or call a non-existent _.prototype() function
Assume .value() and .commit() are interchangeable
Use .reverse() when you need a non-mutating copy
Skip .value() and pass wrappers to functions expecting plain arrays
Overuse advanced prototype methods when a simple chain + unwrap suffices
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about wrapper prototype
Use these when finishing or controlling Lodash chains.
5
Core concepts
🔗01
.value() first
Always unwrap.
Essential
⚙️02
.commit() hybrid
Run + re-chain.
Advanced
🔄03
.plant() clone
New wrapped value.
Pattern
📈04
Not _.prototype()
Methods on wrapper.
Fix myth
🛠️05
Deep dives
/prototype/value...
Next steps
❓ Frequently Asked Questions
It is the set of methods on the sequence wrapper returned by _(value) or _.chain(value)—not a separate _.prototype() function. These methods control unwrapping, eager execution, cloning, and iteration.
.value() (or .valueOf()) unwraps the chain and returns plain JavaScript data. Always call it when you need the final array, object, or number in application code.
Use .commit() when you want to run pending chain steps eagerly but keep chaining on the wrapper—for hybrid pipelines that mix wrapper and plain Lodash calls.
.plant() creates a new wrapper clone at the same pipeline stage but swaps in a different wrapped value, useful for reusing a chain template on new data.
.next() advances lazy iterator-style sequences on the wrapper (Symbol.iterator protocol). .map() is a standard transform that returns another wrapper with a map step queued.
Yes. .reverse() reverses the wrapped array in place inside the chain, similar to Array.prototype.reverse. Clone first if you need to preserve the original order.
Did you know?
There is no standalone _.prototype() function in Lodash. Wrapper prototype refers to methods like .value(), .commit(), and .plant() on the object returned by _(value) or _.chain(value).