Creates a callback from a shorthand value: a property name, a matcher object, a path/value pair, or a function. Part of Lodash Util since 4.0.0 (stable — not deprecated).
Note: Collection methods already call this internally. Use _.iteratee when you need an explicit, reusable function.
Syntax
Call _.iteratee. Start with this line.
Lodash
_.iteratee([func=_.identity])
Call
What it does
_.iteratee([func=_.identity])
Primary signature.
_.iteratee(...)
Call the util helper.
Prefer import iteratee from "lodash/iteratee" when you want a smaller bundle.
Library declarations
Lodash
_.iteratee([func=_.identity])
Parameters
Parameter
Description
func
Optional. Value to convert; default _.identity
Return Value
Return Value
Description
*
A callback function
Lodash Examples
Example 1 — Official: Property Getter
A string becomes a property accessor for each element.
Shorthand._.map(users, 'user') is enough for everyday use.
Explicit. Wrapping with _.iteratee documents the conversion.
Same rules. Both paths use the property iteratee.
When to wrap. Reuse a callback, or normalize input in your own API.
Compatibility
Browser & Runtime Support
_.iteratee is a Lodash Util helper since 4.0.0. It runs anywhere Lodash 4.x runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.0.0+
_.iteratee()
Available in [email protected] full builds and the lodash/iteratee modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.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
_.iterateeLodash 4.0.0+
Bottom line: Safe for production once Lodash 4+ is loaded. Prefer import iteratee from "lodash/iteratee" for smaller bundles. Collection methods already apply these shorthand rules for you.
Frequently Asked Questions
_.iteratee(value) turns a shorthand into a callback. A property name becomes a getter, an object becomes a partial-match predicate (_.matches), a [path, value] array becomes a path-equals check (_.matchesProperty), a function is returned as-is, and null/undefined becomes _.identity.
Usually no. Collection methods already convert shorthands internally—_.map(users, 'user') works without wrapping. Use _.iteratee() when you need to build, store, or reuse a callback, or when your own API must normalize input the Lodash way.
Functions (unchanged), property strings (e.g. 'user'), path arrays for matchesProperty (e.g. ['user', 'fred']), plain objects for matches (e.g. { active: true }), and null/undefined (identity).
_.iteratee('user') extracts a property value (good for map). _.iteratee({ active: true }) returns a predicate that checks partial equality (good for filter).
Calling _.iteratee() with no argument, or with null/undefined, returns _.identity—the default pass-through iteratee Lodash uses when a callback is omitted.
Use it to create reusable callbacks, normalize user-supplied field names in your helpers, document intent, or customize all Lodash iteratee shorthands by wrapping/replacing _.iteratee (advanced).