Lodash _.functionsIn() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Object

Definition

Creates an array of function property names from own and inherited enumerable properties of object. Like _.functions, but also walks the prototype chain. Part of Lodash Object since 4.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 _.functionsIn. Start with this line.

Lodash
_.functionsIn(object)
CallWhat it does
_.functionsIn(object)Primary signature.

Prefer import functionsIn from "lodash/functionsIn" when you want a smaller bundle.

Library declarations
Lodash
_.functionsIn(object)

Parameters

ParameterDescription
objectRequired. The object to inspect

Return Value

Return ValueDescription
*Array of own + inherited enumerable function names

Lodash Examples

Example 1 — Official: Own + Inherited Names

Own function properties and the enumerable prototype method are listed.

Lodash
function Foo() {
  this.a = _.constant('a');
  this.b = _.constant('b');
}

Foo.prototype.c = _.constant('c');

_.functionsIn(new Foo);
// → ['a', 'b', 'c']
Try It Yourself

How It Works

  1. Own props. a and b are functions on the instance.
  2. Prototype. c is assigned on Foo.prototype (enumerable).
  3. Walk. Own keys first, then inherited enumerable keys.
  4. Result. ["a", "b", "c"].

Example 2 — vs _.functions

Same object; functions skips the prototype method.

Lodash
function Foo() {
  this.a = _.constant('a');
  this.b = _.constant('b');
}
Foo.prototype.c = _.constant('c');

_.functions(new Foo());
// → ["a", "b"]

_.functionsIn(new Foo());
// → ["a", "b", "c"]
Try It Yourself

How It Works

  1. functions. Own keys only → a, b.
  2. functionsIn. Also walks the prototype → adds c.
  3. Same filter. Both keep only function-valued properties.
  4. Choose. Use functionsIn when prototype APIs matter.

Example 3 — Mixed Data Plus Prototype Method

Non-function properties are ignored; enumerable inherited methods are kept.

Lodash
function Service() {
  this.name = "demo";
  this.run = function () { return 1; };
}
Service.prototype.stop = function () { return 0; };

_.functionsIn(new Service());
// → ["run", "stop"]
Try It Yourself

How It Works

  1. Own. name is data; run is a function.
  2. Inherited. stop is an enumerable prototype method.
  3. Filter. Only function names remain.
  4. Result. ["run", "stop"].

Example 4 — Object With No Functions

When nothing callable is enumerable, you get an empty array.

Lodash
_.functionsIn({ a: 1, b: "hi" });
// → []

_.functionsIn({});
// → []
Try It Yourself

How It Works

  1. Scan. Own and inherited enumerable keys are checked.
  2. No matches. None of the values are functions.
  3. Empty. Result is [], not null.
  4. Safe. Easy to test with .length === 0.

Example 5 — ES Class Methods Are Usually Missed

Class methods are non-enumerable on the prototype, so they are skipped.

Lodash
function Greeter(name) {
  this.name = name;
  this.greetOwn = function () {
    return "hi " + this.name;
  };
}
Greeter.prototype.greet = function () {
  return "hello " + this.name;
};
Object.defineProperty(Greeter.prototype, "greet", {
  enumerable: false
});

var g = new Greeter("Ada");

_.functionsIn(g);
// → ["greetOwn"]

// greet exists, but it is non-enumerable → skipped
Try It Yourself

How It Works

  1. Own method. greetOwn is enumerable on the instance → listed.
  2. Prototype. greet is defined as non-enumerable.
  3. Filter. Non-enumerable inherited methods are ignored.
  4. Tip. Constructor/prototype assignments are enumerable by default — those appear.

Browser & Runtime Support

_.functionsIn is a Lodash Object helper (available since 4.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 4.0.0+

_.functionsIn()

Available in [email protected] full builds and the lodash/functionsIn modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 4.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.functionsIn Lodash 4.0.0+

Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import functionsIn from "lodash/functionsIn" for smaller builds. Use _.functions when inherited methods must be ignored.

Frequently Asked Questions

_.functionsIn(object) returns an array of function property names from own and inherited enumerable properties of object.
_.functions lists own enumerable function names only. _.functionsIn also includes inherited enumerable function names from the prototype chain.
Usually no. Class methods are non-enumerable on the prototype. _.functionsIn only reports enumerable function properties.
No. Order follows Lodash key iteration across own and inherited enumerable keys. Sort the array yourself if needed.
No. It returns string-keyed property names only.
Use import functionsIn from "lodash/functionsIn" or require("lodash/functionsIn"). Full build: import _ from "lodash" then _.functionsIn.

Next: _.get()

Safely get a nested value by path with an optional default.

_.get() tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful