Lodash _.create() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Object

Definition

Creates an object that inherits from a prototype. If a properties object is given, its own enumerable string keys are assigned onto the result. Since Lodash 2.3.0.

Pass the object and path or keys shown below. Check whether the helper mutates or returns a new object.

Syntax

Call _.create. Start with this line.

Lodash
_.create(prototype, [properties])
CallWhat it does
_.create(prototype, [properties])Primary signature.
_.create(object)Work with an object’s keys, values, or paths.

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

Library declarations
Lodash
_.create(prototype, [properties])

Parameters

ParameterDescription
prototypeRequired. Object to inherit from (or null)
propertiesOptional. Own enumerable string keys to assign

Return Value

Return ValueDescription
*New object linked to prototype

Lodash Examples

Example 1 — Official: Prototypal Inheritance

Set a constructor prototype that inherits from another.

Lodash
function Shape() {
  this.x = 0;
  this.y = 0;
}

function Circle() {
  Shape.call(this);
}

Circle.prototype = _.create(Shape.prototype, {
  constructor: Circle
});

var circle = new Circle();
circle instanceof Circle;
// → true

circle instanceof Shape;
// → true
Try It Yourself

How It Works

  1. Shape.call(this) runs the parent constructor on the instance.
  2. create builds a prototype object linked to Shape.prototype.
  3. constructor is restored as an own property on that prototype.
  4. instanceof walks the chain → both checks pass.

Example 2 — Prototype Plus Own Properties

Second argument copies plain values onto the new object.

Lodash
var proto = { greet: function () { return "hi " + this.name; } };

var user = _.create(proto, { name: "Ada" });

user.greet();
// → "hi Ada"

user.hasOwnProperty("name");
// → true

user.hasOwnProperty("greet");
// → false
Try It Yourself

How It Works

  1. proto holds the shared greet method.
  2. create links user to proto and assigns name.
  3. greet() is found via the prototype chain.
  4. name is own; greet is inherited.

Example 3 — vs Native Object.create

Lodash accepts plain values; native expects descriptors.

Lodash
var proto = { kind: "base" };

_.create(proto, { id: 7 }).id;
// → 7

Object.create(proto, {
  id: { value: 7, enumerable: true, writable: true, configurable: true }
}).id;
// → 7
Try It Yourself

How It Works

  1. Both set [[Prototype]] to proto.
  2. Lodash copies { id: 7 } like assign.
  3. Native needs a full descriptor bag for the same own prop.
  4. Use Lodash when you want plain-object ergonomics.

Example 4 — null Prototype Dictionary

No Object.prototype methods on the key space.

Lodash
var map = _.create(null);
map.color = "red";

map.color;
// → "red"

Object.getPrototypeOf(map);
// → null

"toString" in map;
// → false
Try It Yourself

How It Works

  1. create(null) makes an object with no prototype.
  2. Own keys like color work normally.
  3. toString is not inherited from Object.prototype.
  4. Use case. Safe maps when keys might collide with built-ins.

Example 5 — Own vs Inherited Keys

keys sees own props; keysIn also walks the prototype.

Lodash
var proto = { shared: 1 };
var obj = _.create(proto, { own: 2 });

_.keys(obj);
// → ["own"]

_.keysIn(obj);
// → ["own", "shared"]
Try It Yourself

How It Works

  1. own was assigned via the properties argument.
  2. shared lives on the prototype only.
  3. keys lists own enumerable keys.
  4. keysIn includes inherited enumerable keys.

Browser & Runtime Support

_.create is a Lodash Object helper (since 2.3.0). It runs anywhere Lodash 4.x runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 2.3.0+

_.create()

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

Bottom line: Safe for production once Lodash is loaded. Prefer import create from "lodash/create". Native Object.create is fine when you need descriptor control.

Frequently Asked Questions

_.create(prototype, [properties]) creates an object that inherits from prototype. If properties is given, its own enumerable string keys are assigned onto the new object.
Same prototype link. Object.create's second argument expects property descriptors; _.create takes a plain object of values (like _.assign).
No. Only own enumerable string-keyed properties are copied — same rule as _.assign.
An object with no prototype — useful for dictionary maps without Object.prototype keys.
No. The new object links to the prototype. Reads may walk up the chain; writes create own properties.
Use import create from "lodash/create" or require("lodash/create"). Full build: import _ from "lodash" then _.create.

Next: _.defaults()

Assign source properties for undefined keys on the destination.

_.defaults() 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.

11 people found this page helpful