---
title: "Discussion on \"Problem with using ‘new’ for Inheritance\" | Hashnode"
description: "Discussion on \"Problem with using ‘new’ for Inheritance\". Imagine you have the following block of code.\nfunction Animal() {\n     this.offspring = [];\n}\nfunction Dog() {\n}\nDog.prototype = new Animal();\nDog.prototype.constructor = Dog;\nvar d1 = new Dog();\nvar d2 = new Dog();\nvar pup = new Dog();\nd1.offspring...."
url: "https://hashnode.com/posts/problem-with-using-new-for-inheritance-c94ed6a65996/6125c5c8663d427e19ffb75d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Problem with using ‘new’ for Inheritance](https://blog.adarshkonchady.com/problem-with-using-new-for-inheritance-c94ed6a65996?utm_source=hashnode&utm_medium=feed)

Imagine you have the following block of code. function Animal() { this.offspring = \[\]; } function Dog() { } Dog.prototype = new Animal(); Dog.prototype.constructor = Dog; var d1 = new Dog(); var d2 = new Dog(); var pup = new Dog(); d1.offspring....

Mar 18, 2016 · 1 min read · blog.adarshkonchady.com  
Read the article

## Written by

[Adarsh Konchady](https://hashnode.com/@adarshkonchady)

@adarshkonchady · Minnesota, US

  
[View profile](https://hashnode.com/@adarshkonchady)

Interested in all things Web !

As a Senior Principal Engineer at CVSHealth, I specialize in building and optimizing cvs.com to deliver a superior guest experience. Using the latest web technologies, my team and I work diligently to create a user-friendly and intuitive platform that exceeds expectations.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
