Object.create(proto) creates a new, empty object whose prototype is proto, and it never runs a constructor. The new operator calls a constructor function or class: it creates an object, links it to Constructor.prototype, runs the constructor body with this bound to that object, and returns it.
Both end up with objects linked through the prototype chain. The difference is who decides the prototype and whether initialisation code runs.
Object.create links an object to a prototype
new operator builds an instance
Object.create links an object to a prototypeObject.create(proto, propertiesObject?) returns a new object and sets its internal [[Prototype]] to proto. The first argument must be an object or null; anything else throws a TypeError.
dog has no speak property of its own. The lookup fails on dog, moves up to animal, and finds the method there. Nothing initialises name, so you assign it yourself.
The optional second argument is a map of property descriptors, the same shape that Object.defineProperties accepts. Properties created this way are non-writable, non-enumerable and non-configurable unless you say otherwise.
Object.create(null) produces an object that inherits nothing, not even toString or hasOwnProperty. It is a safe plain dictionary because keys like __proto__ or constructor cannot collide with inherited members. For new code, a Map is usually the better key-value container.
new operator builds an instanceWhen you write new Person("Alice"), the engine performs these steps:
Person.prototype.Person with this bound to the new object and the given arguments.Put shared methods on Person.prototype, not inside the constructor. Defining this.greet = function () {...} in the constructor, as many older tutorials do, creates a new function object for every instance.
new with ES2015 classesclass syntax is the modern form of the same mechanism. A class must be called with new; calling it as a plain function throws a TypeError.
Private fields such as #age and extends/super initialisation only work through new, which is one reason Object.create is not a drop-in replacement for classes.
| Aspect | Object.create(proto) | new Constructor() |
|---|---|---|
| Prototype source | The object you pass in | Constructor.prototype |
| Runs initialisation code | No | Yes, the constructor body |
| Result has own properties | Only those you add or describe | Those the constructor assigns |
| Can create a prototype-less object | Yes, with null | No |
Works with class private fields | No | Yes |
| Typical use | Delegation, prototype setup, dictionaries | Creating instances of a type |
Before class, inheritance between constructors was set up with Object.create. You still see it in older code and libraries.
Object.create(Animal.prototype) makes the prototype chain without calling Animal, which is the point: assigning new Animal() as the prototype would run the parent constructor with no arguments and leave stray properties on the shared prototype. Today you would write class Dog extends Animal instead.
new on a constructor function. In non-strict code this becomes the global object; in strict mode and modules it is undefined and throws.Object.create(obj) to copy obj. It does not copy; it links. Changes to obj appear on the new object unless shadowed.Object.setPrototypeOf or assigning __proto__ on hot paths. Engines optimise objects whose prototype is fixed at creation, so prefer Object.create or a constructor.Object.create call a constructor?No. It only creates an object and sets its prototype. If you need initialisation, write a factory function or call an init method yourself.
Object.create faster than new?Neither is consistently faster in a way that matters for application code. Modern engines optimise both. Choose based on whether you need a constructor, not on speed.
Object.create instead of classes?Yes, for simple delegation between plain objects. For types with private fields, extends, or instanceof checks against a class, use class with new.
Object.create(null) do differently from {}?{} inherits from Object.prototype, so it has toString and friends. Object.create(null) has no prototype at all, so those members are absent.
Object.create sets the prototype you choose and runs no code, so it suits delegation and prototype-less dictionaries. new links the instance to the constructor's prototype property and runs the constructor, so it suits creating instances of a type. In modern JavaScript, use class with new for instances, and reach for Object.create when you want an object that inherits directly from another object.