Underscore.js _.create() Method

Beginner
5 min read
Updated: Nov 2026
4 examples
Object

Definition

Creates a new object with the given prototype, optionally attaching props as own properties — basically Object.create, without the property-descriptor ceremony (official Underscore docs). Stable Object helper — not deprecated.

Pass the required arguments shown below. Underscore object helpers usually return a new value — check whether the source object is mutated.

Syntax

Call _.create. Start with this line.

Underscore
_.create(prototype, props)
CallWhat it does
_.create(prototype, props)Primary signature.
_.create(...)Call with the arguments your case needs.

Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.

Library declarations
Underscore
_.create(prototype, props)

Parameters

ParameterDescription
prototypeRequired. Object to inherit from (null allowed)
propsOptional. Plain object of own properties to attach

Return Value

Return ValueDescription
*New object linked to prototype

Underscore.js Examples

Example 1 — Prototype Methods + Own Data

Share a method on the prototype; keep per-object data in props.

Underscore
var Animal = {
  speak: function () { return this.name + " speaks"; }
};

var dog = _.create(Animal, { name: "Rex" });

dog.name;     // → "Rex"
dog.speak();  // → "Rex speaks"
Try It Yourself

How It Works

  1. Link. dog’s prototype is Animal.
  2. Own prop. name is copied onto dog.
  3. Lookup. speak is found on Animal.
  4. this. Inside speak, this is dog.

Example 2 — Official-Style Instance

Attach own props onto a constructor’s prototype — the docs’ pattern.

Underscore
function Stooge() {}
Stooge.prototype.silly = true;

var moe = _.create(Stooge.prototype, { name: "Moe" });

moe.name;                 // → "Moe"
moe.silly;                // → true
Object.getPrototypeOf(moe) === Stooge.prototype;
// → true
Try It Yourself

How It Works

  1. Prototype. Use Stooge.prototype as the inheritance root.
  2. Props. { name: "Moe" } becomes an own property.
  3. Inherited. silly comes from the prototype.
  4. Docs idea. Same shape as the official Underscore _.create sample.

Example 3 — null Prototype Map

Build a bare dictionary with no Object.prototype baggage.

Underscore
var map = _.create(null, { a: 1, b: 2 });

map.a;           // → 1
map.toString;    // → undefined
Object.getPrototypeOf(map);  // → null
Try It Yourself

How It Works

  1. null proto. No inherited methods like toString.
  2. Own props. a and b are still attached normally.
  3. Safe maps. Useful when keys might collide with built-ins (e.g. "toString").
  4. Trade-off. Helpers that expect Object.prototype may fail — know your callers.

Example 4 — Own Keys vs Inherited Keys

See what _.keys and _.allKeys report after _.create.

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

_.keys(user);      // → ["name"]
_.allKeys(user);   // → ["name", "role"]
_.has(user, "name");   // → true
_.has(user, "role");   // → false
Try It Yourself

How It Works

  1. Own. name was copied from props.
  2. Inherited. role lives on proto.
  3. keys. Own names only.
  4. allKeys / has. Show the full chain vs own-only checks.

Browser & Runtime Support

_.create ships with Underscore.js (1.x) and builds on native Object.create. It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.

✓ Stable · Underscore 1.x

_.create()

Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded.

100% With Underscore 1.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 Underscore 1.x+

Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API by itself — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]).

Frequently Asked Questions

_.create(prototype, props) returns a new object whose [[Prototype]] is prototype, then copies own properties from props onto it. Official idea: Object.create without property-descriptor ceremony.
Same core job. _.create accepts a plain props object of values. Native Object.create’s second argument is a property descriptors map.
Yes. _.create(null, props) makes a bare object with no inherited Object.prototype methods.
No. Own enumerable properties are copied by reference (shallow).
Yes. Methods on the prototype are shared through the prototype chain — not copied onto each instance.
When you want prototypal inheritance for a few objects without writing a constructor or class.

Next: _.functions()

Return a sorted array of an object’s function property names.

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