---
title: "Comment by Ankur Rajput on \"What the heck does \"new\" operator in JS do?\" | Hashnode"
description: "This is really good. There is only one exception in the returned value that I am aware of. If the constructor function returns an object then instead of the new"
url: "https://hashnode.com/posts/what-the-heck-does-new-operator-in-js-do/60e97cc96d962b01bdecbed9/comment/60e9e7e3c551f16b0f848683"
---

[Discussion](https://hashnode.com/posts/what-the-heck-does-new-operator-in-js-do/60e97cc96d962b01bdecbed9)

Comment [What the heck does "new" operator in JS do?](https://hashnode.com/posts/what-the-heck-does-new-operator-in-js-do/60e97cc96d962b01bdecbed9)

[Ankur Rajput](https://hashnode.com/@rajputankur023)

[Jul 10, 2021](https://hashnode.com/posts/what-the-heck-does-new-operator-in-js-do/60e97cc96d962b01bdecbed9/comment/60e9e7e3c551f16b0f848683)

This is really good.

There is only one exception in the returned value that I am aware of. If the constructor function returns an object then instead of the newly created object that object will be returned. The return statement will be ignored if it is of a primitive type.

[Munish Thakur](https://hashnode.com/@munish710)

[Jul 11, 2021](https://hashnode.com/posts/what-the-heck-does-new-operator-in-js-do/60e97cc96d962b01bdecbed9/comment/60e9e7e3c551f16b0f848683#reply-60ea9761c551f16b0f84a1b2)

Hi Ankur you are absolutely right. I mentioned about the non-null object, but intentionally dropped the primitive value return as that would surely confuse beginners, but I think i should add it for the sake of completeness.
