Because you will call the custom type constructor (aka class) that you are trying to inherit. And this can have side effects. Imagine the following:
var instancesOfParentClass = 0; function ParentClass (options) { instancesOfParentClass++; this.options = options; } function ChildClass () {} ChildClass.prototype = new ParentClass();
Your counter has been increased, but you really have not created a useful instance of ParentClass.
Another problem: all instance properties (see this.options ) will be present on the ChildClass prototype, and you probably don't want this.
Note When using a constructor, you can have instance properties and general properties. For instance:
function Email (subject, body) { // instance properties this.subject = subject; this.body = body; } Email.prototype.send = function () { // do some AJAX to send email }; // create instances of Email emailBob = new Email("Sup? Bob", "Bob, you are awesome!"); emailJohn = new Email("Where my money?", "John, you owe me one billion dollars!"); // each of the objects (instances of Email) has its own subject emailBob.subject // "Sup? Bob" emailJohn.subject // "Where my money?" // but the method `send` is shared across instances emailBob.send === emailJohn.send // true
source share