JavaScript Object.create() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Object

Definition

Object.create(proto) makes a new empty object whose prototype is proto. The new object inherits methods and properties from that prototype.

You can pass a second argument with property descriptors, or use Object.create(null) for an object with no prototype chain.

Syntax

Call Object.create() like this. Start with this line.

JavaScript
Object.create(proto)
Object.create(proto, propertiesObject)
CallWhat it does
Object.create(proto)Creates a new object that inherits from proto.
Object.create(proto, propertiesObject)Same, and also defines own properties from descriptors.

Built into JavaScript. Call on Object — no import required.

Library declarations
JavaScript
Object.create(proto, propertiesObject)
JavaScript
create(o: object | null, properties?: PropertyDescriptorMap): any;

Parameters

ParameterDescription
protoRequired. The object to use as the new object's prototype, or null for no prototype.
propertiesObjectOptional. An object of property descriptors, like the map used by Object.defineProperties().

Return Value

Return ValueDescription
objectA new object linked to the given prototype.

JavaScript Examples

Example 1 — Basic Use

Create an object that inherits a method from a prototype.

JavaScript
var proto = {
  greet: function () {
    return "hi";
  }
};
var obj = Object.create(proto);

console.log(obj.greet());                       // hi
console.log(Object.getPrototypeOf(obj) === proto); // true
console.log(obj.hasOwnProperty("greet"));       // false
Try It Yourself

How It Works

  1. Make a prototype. proto holds a greet method.
  2. Link a new object. Object.create(proto) returns an empty object that inherits from proto.
  3. Inherited, not own. greet works, but hasOwnProperty("greet") is false.

Example 2 — Null Prototype

Use null as the prototype when you want a clean bag of keys.

JavaScript
var blank = Object.create(null);
blank.name = "Ada";

console.log(blank.name);                          // Ada
console.log(Object.getPrototypeOf(blank) === null); // true
Try It Yourself

How It Works

  1. No prototype. Object.create(null) starts with no inherited methods.
  2. Own data only. You can still add your own properties, like name.
  3. Check the link. getPrototypeOf returns null for this object.

Example 3 — With Property Descriptors

The second argument defines own properties while the first sets the prototype.

JavaScript
var base = { role: "guest" };
var user = Object.create(base, {
  name: {
    value: "Sam",
    writable: true,
    enumerable: true,
    configurable: true
  }
});

console.log(user.name);                   // Sam
console.log(user.role);                   // guest
console.log(user.hasOwnProperty("name")); // true
console.log(user.hasOwnProperty("role")); // false
Try It Yourself

How It Works

  1. Own property. name is defined on user itself.
  2. Inherited property. role comes from base through the prototype.
  3. Own vs inherited. hasOwnProperty is true for name and false for role.

Browser & Runtime Support

Object.create() has been part of JavaScript since ES5 and is Baseline Widely available everywhere modern code runs.

✓ Baseline · ES5

Object.create()

Supported in all modern browsers and Node.js. Internet Explorer 9+ also includes it.

99% Modern browser support
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
Object.create Excellent

Bottom line: Use Object.create() freely. It works in every current browser and runtime.

Frequently Asked Questions

It creates a new object whose prototype is the object you pass in. The new object starts empty unless you also pass property descriptors.
{} creates an object that inherits from Object.prototype. Object.create(proto) lets you choose any prototype, including null.
It makes a plain dictionary with no inherited methods. That avoids clashes with keys like toString or constructor.
No. It only sets the prototype link. Properties stay on the prototype until the child shadows them.
Yes. Assign them normally, or use Object.defineProperty / Object.defineProperties for more control.

Next: defineProperties()

Define several properties with descriptors at once.

defineProperties() 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.

8 people found this page helpful