Interview answer drill

Use this JavaScript interview question to rehearse a quick answer, common mistake, follow-up, and production pitfall.

Object.create vs new in JavaScript (Prototypes, Constructors, and Inheritance)Frontend interview answer

MediumIntermediateJavascript
Interview focus

This JavaScript interview question tests whether you can explain Object.create vs new in JavaScript: what is the difference, connect it to production trade-offs, and handle common follow-up questions.

  • Object.create vs new in JavaScript: what is the difference explanation without falling back to memorized docs wording
  • Objects and Prototypes reasoning, edge cases, and production failure modes
  • How you would answer the most likely JavaScript interview follow-up
Practice more JavaScript interview questions
Interview quick answer

Both Object.create and the new keyword create objects, but in different ways. new calls a constructor and sets up prototype + initialization, while Object.create creates a plain object with a specified prototype without running any constructor. Understanding this is key to JavaScript's prototypal inheritance.

Full interview answer

The core difference

Both create objects, but:

  • new creates an object by calling a constructor function.
  • Object.create creates an object with a given prototype without calling any constructor.

So the real difference is: constructor-based creation vs pure prototype-based creation.

Feature

new Constructor()

Object.create(proto)

Calls constructor?

Yes

No

Prototype of the object

Constructor.prototype

Exactly proto

Can run initialization logic?

Yes (inside constructor)

No (unless you call a function manually)

Can pass arguments?

Yes

No (directly)

Typical use

Class-like instantiation

Pure delegation / manual prototype chains

Side-by-side comparison.

What actually happens with new

When you write:

const obj = new Foo(a, b);

JavaScript does roughly this:
1) Create an empty object
2) Set its [[Prototype]] to Foo.prototype
3) Call Foo with this = obj
4) If Foo returns an object, use it; otherwise return obj

JAVASCRIPT
function Foo(x) {
  this.x = x;
}

const a = new Foo(10);

// Equivalent (simplified):
const a2 = {};
Object.setPrototypeOf(a2, Foo.prototype);
Foo.call(a2, 10);
// return a2
                  

What Object.create does

Object.create(proto) simply creates a new object whose [[Prototype]] is proto. Nothing else happens. No constructor runs. No properties are set (unless you pass a second descriptor argument).

JAVASCRIPT
const proto = {
  greet() {
    return 'hi';
  }
};

const obj = Object.create(proto);

obj.greet(); // 'hi'
obj.hasOwnProperty('greet'); // false (comes from prototype)
                  

Important interview traps

1) Object.create(null) creates an object with no prototype. It does not inherit from Object.prototype. No toString, no hasOwnProperty. Useful for pure dictionaries / maps.

2) Forgetting initialization: With Object.create, if you need state, you must set it manually or call an init function.

3) class is just syntax sugar: class A {} still uses new and prototypes under the hood.

Inheritance patterns

JAVASCRIPT
// Using new (constructor/class style)
function Animal(name) {
  this.name = name;
}
Animal.prototype.speak = function () {
  return this.name + ' makes a noise';
};

function Dog(name) {
  Animal.call(this, name); // init
}
Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;

const d1 = new Dog('Rex');

// Using pure delegation (Object.create style)
const animal = {
  speak() {
    return this.name + ' makes a noise';
  }
};

const dog = Object.create(animal);
dog.name = 'Rex';
                  

When should you use which?

  • Use new / class when:
  • You want a clear construction step
  • You need arguments + validation + setup logic
  • You follow a class-like domain model
  • Use Object.create when:
  • You want pure prototype delegation
  • You want to avoid constructor side effects
  • You want special objects like Object.create(null)
  • You are building lightweight objects that just delegate behavior

One-sentence answer

new creates an object by running a constructor and wiring its prototype, while Object.create creates an object with a specified prototype only, without calling any constructor.

Similar questions
Guides
Preparing for interviews?

Use this as one explanation rep, then continue with the JavaScript interview questions cluster or a guided prep path.