_.identity is a Lodash Util helper since 0.1.0. It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 0.1.0+
_.identity()
Available in [email protected] full builds and the lodash/identity modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 0.1+
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
_.identityLodash 0.1.0+
Bottom line: Safe for production once Lodash is loaded. Prefer import identity from "lodash/identity" for smaller bundles. Use it as a named pass-through iteratee or default transform.
Frequently Asked Questions
_.identity(value) returns value unchanged. Official: _.identity(object) === object is true — same reference, not a clone.
Same behavior for one argument. _.identity is a named Lodash helper you can pass by reference to map, filter, flow, and other APIs.
_.identity returns what you pass in. _.constant(v) always returns the fixed v and ignores arguments.
_.filter(arr, _.identity) keeps truthy values and drops falsy ones — a concise truthy filter.
No. It returns the same reference. Mutating the result mutates the original.
Use import identity from "lodash/identity" or require("lodash/identity"). Full build: import _ from "lodash" then _.identity.