Creates a clone of the chain sequence, planting a new value as the wrapped value. Queued actions (like .map) stay; only the starting data changes. Call it on a Lodash wrapper from _(value) or _.chain(value). Part of Lodash Seq (since 3.2.0).
Call it on a Lodash wrapper. Finish with .value() when you need a plain result.
Syntax
Call _.prototype.plant(). Start with this line.
Lodash
wrapper.plant(value)
Call
What it does
wrapper.plant(value)
Primary signature.
Prefer import _ from "lodash" (full build) when you need wrapper prototype helpers.
Library declarations
Lodash
wrapper.plant(value)
Parameters
Parameter
Description
Receiver
Required. A Lodash wrapper with queued actions
value
Required. New data to plant as the wrapped value
Return Value
Return Value
Description
*
New wrapper (clone of the chain)
Lodash Examples
Example 1 — Official plant
Reuse map(square) on a new array.
Lodash
function square(n) {
return n * n;
}
var wrapped = _([1, 2]).map(square);
var other = wrapped.plant([3, 4]);
other.value();
// → [9, 16]
Note. Extra steps after plant apply only to that clone.
Compatibility
Browser & Runtime Support
Wrapper .plant() is a Lodash Seq prototype method (since 3.2.0). It needs no special browser APIs beyond loading Lodash.
✓ Stable · Lodash 3.2.0+
_.prototype.plant()
Available in [email protected] full builds when using _(value) / _.chain(value). Works in evergreen browsers and Node / Bun / Deno when Lodash is installed.
100%With Lodash 3.2.0+
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
.plant()Lodash 3.2.0+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer the full lodash build for Seq / wrapper APIs.
Frequently Asked Questions
It creates a clone of the chain sequence with a new wrapped value. Official docs: _( [1,2] ).map(square).plant([3,4]).value() → [9,16] while the original wrapper still yields [1,4].
No. It returns a new wrapper. The original chain and its value stay independent.
A single value — the new data to plant as the wrapped value. Existing queued actions (map, filter, …) apply to that value when you unwrap.
No. It returns another Lodash wrapper. Call .value() (or keep chaining) to get plain JavaScript data.
When you already built a transform pipeline and want to replay it on different inputs without rewriting the chain.
No. Call it on a wrapper from _(value) or _.chain(value). Docs list it as _.prototype.plant().