---
title: "Discussion on \"‘return’ inside constructors\" | Hashnode"
description: "Discussion on \"‘return’ inside constructors\". function Eg() {\n  this.name = 10;\n  return 'adarsh';\n}\nnew Eg(); // Returns {name: 10}\n\nHowever, if you return a object inside a constructor function, that object will be returned.\nfunction Eg() {\n  this.name = 10;\n  return { \n    name: 'adarsh' \n  }..."
url: "https://hashnode.com/posts/return-inside-constructors-664148320278/6125c5d2663d427e19ffb76f"
---

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

Discussion

# [‘return’ inside constructors](https://blog.adarshkonchady.com/return-inside-constructors-664148320278?utm_source=hashnode&utm_medium=feed)

function Eg() { this.name = 10; return 'adarsh'; } new Eg(); // Returns {name: 10} However, if you return a object inside a constructor function, that object will be returned. function Eg() { this.name = 10; return { name: 'adarsh' }...

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.
