JavaScript Object.create()

Definition and usage

Object.create() Methods used to create a new object from an existing object.

Related methods:

Object.assign() Copy the properties of the source object to the target object.

Object.create() Create a new object from an existing object.

Object.fromEntries() Create an object from a list of key/value pairs.

Instance

// Create an object
const person = {
  firstName: "Bill",
  lastName: "Gates"
};
// Create a new object
const man = Object.create(person);
man.firstName = "Peter";

Try it yourself

Syntax

Object.create(object, properties)

Parameter

Parameter Description
object Required. Existing object.
properties

Optional. The property descriptor to add or modify:

  • value: value
  • writable : true|false
  • enumerable : true|false
  • configurable : true|false
  • get : function
  • set : function

Return value

Type Description
Object Create a new object.

Browser support

Object.create() Is a feature of ECMAScript5 (ES5).

Since July 2013, all modern browsers fully support ES5 (JavaScript 2009):

Chrome Edge Firefox Safari Opera
Chrome 23 IE/Edge 11 Firefox 21 Safari 6 Opera 15
September 2012 September 2012 April 2013 July 2012 July 2013