Like _.forIn, but iterates properties of object in the opposite order. Visits own and inherited enumerable string keys. Part of Lodash Object since 2.0.0 (stable — not deprecated).
Pass the object and path or keys shown below. Check whether the helper mutates or returns a new object.
Syntax
Call _.forInRight. Start with this line.
Lodash
_.forInRight(object, [iteratee])
Call
What it does
_.forInRight(object, [iteratee])
Primary signature.
_.forInRight(object)
Work with an object’s keys, values, or paths.
Prefer import forInRight from "lodash/forInRight" when you want a smaller bundle.
Library declarations
Lodash
_.forInRight(object, [iteratee])
Parameters
Parameter
Description
object
Required. The object to iterate over
iteratee
Optional. Invoked per key; default _.identity
Return Value
Return Value
Description
*
The original object
Lodash Examples
Example 1 — Official: Reverse Key Order
Own and inherited keys are visited opposite to _.forIn.
Both reverse. Direction is reversed relative to their forward counterparts.
Choose. Use forOwnRight when inherited keys must be ignored.
Compatibility
Browser & Runtime Support
_.forInRight is a Lodash Object helper (available since 2.0.0, stable in 4.x). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 2.0.0+
_.forInRight()
Available in [email protected] full builds and the lodash/forInRight modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
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
_.forInRightLodash 2.0.0+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import forInRight from "lodash/forInRight" for smaller builds. Use _.forOwnRight when inherited keys must be skipped.
Frequently Asked Questions
_.forInRight(object, iteratee) iterates over an object's own and inherited enumerable string-keyed properties in the opposite order of _.forIn. It returns the original object.
The iteratee is invoked with (value, key, object).
Yes. Explicitly return false from the iteratee to exit iteration early.
Same key coverage (own + inherited). Opposite walk order.
_.forInRight also visits inherited enumerable keys. _.forOwnRight visits own keys only, also in reverse.
Use import forInRight from "lodash/forInRight" or require("lodash/forInRight"). Full build: import _ from "lodash" then _.forInRight.