Lodash _.functions() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Object

Definition

Creates an array of function property names from own enumerable properties of object. Inherited prototype methods are skipped. Part of Lodash Object since 0.1.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 _.functions. Start with this line.

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

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

Library declarations
Lodash
_.functions(object)

Parameters

ParameterDescription
objectRequired. The object to inspect

Return Value

Return ValueDescription
*Array of own enumerable function names

Lodash Examples

Example 1 — Official: Own Function Names

Own function properties are listed; the prototype method is skipped.

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

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

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

How It Works

  1. Own props. a and b are functions on the instance.
  2. Prototype. c lives on Foo.prototype.
  3. Filter. Only own enumerable function names are kept.
  4. Result. ["a", "b"] — c is excluded.

Example 2 — vs _.functionsIn

functionsIn also picks up inherited enumerable function names.

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. Enumerable. Inherited methods must be enumerable to appear.
  4. Choose. Use functionsIn when prototype APIs matter.

Example 3 — Mixed Data and Methods

Non-function own properties are ignored.

Lodash
var api = {
  name: "demo",
  count: 2,
  run: function () { return 1; },
  stop: function () { return 0; }
};

_.functions(api);
// → ["run", "stop"]
Try It Yourself

How It Works

  1. Own keys. Four enumerable properties on api.
  2. Filter. name and count are not functions.
  3. Keep. Only run and stop remain.
  4. Use. Handy for discovering callable API surface on a plain object.

Example 4 — Object With No Functions

When nothing is callable, you get an empty array.

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

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

How It Works

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

Example 5 — ES Class Methods Are Usually Missed

Class methods live on the prototype and are typically non-enumerable.

Lodash
class Greeter {
  constructor(name) {
    this.name = name;
    this.greetOwn = function () {
      return "hi " + this.name;
    };
  }
  greet() {
    return "hello " + this.name;
  }
}

var g = new Greeter("Ada");

_.functions(g);
// → ["greetOwn"]   (own function only)

_.functionsIn(g);
// → ["greetOwn"]   (greet is non-enumerable on the prototype)
Try It Yourself

How It Works

  1. Own method. greetOwn is assigned on the instance → listed.
  2. Class method. greet lives on the prototype and is non-enumerable.
  3. functions. Sees only own enumerable function names.
  4. functionsIn. Still skips non-enumerable prototype methods.

Browser & Runtime Support

_.functions is a Lodash Object helper (available since 0.1.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 0.1.0+

_.functions()

Available in [email protected] full builds and the lodash/functions 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
_.functions Lodash 0.1.0+

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

Frequently Asked Questions

_.functions(object) returns an array of the object's own enumerable property names whose values are functions. Inherited methods are not included.
_.functions returns own enumerable function names only. _.functionsIn also includes inherited enumerable function names from the prototype chain.
Methods declared in a class body live on the prototype (and are usually non-enumerable). _.functions only inspects own enumerable properties, so those methods are skipped.
No. Order follows Lodash's own-key iteration (similar to Object.keys). Sort the array yourself if you need alphabetical output.
Yes. Any value for which Lodash treats as a function is included — regular, arrow, async, and generator functions.
Use import functions from "lodash/functions" or require("lodash/functions"). Full build: import _ from "lodash" then _.functions.

Next: _.functionsIn()

List own and inherited enumerable function property names.

_.functionsIn() tutorial →

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