Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8860785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:20:15+00:00 2026-06-14T15:20:15+00:00

Someone in the question Is there any reason to manually return in a constructor

  • 0

Someone in the question Is there any reason to manually return in a constructor function mentioned that he thought that returning arbitrary objects in constructor calls may have been introduced in a recent version of Javascript.

I am unable to access alternate browsers right now, and I can’t find any information about this, so what version introduced this, or has it existed since forever?

If it hasn’t been around for long, then what browser versions will support it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:20:17+00:00Added an answer on June 14, 2026 at 3:20 pm

    If you look in ECMA-262 ed 1 (which is still available online from the ECMA site) you will see:

    11.2.2 The new operator

    The production NewExpression : new NewExpression is evaluated as follows:

    1. Evaluate NewExpression.
    2. Call GetValue(Result(1)).
    3. If Type(Result(2)) is not Object, generate a runtime error.
    4. If Result(2) does not implement the internal [[Construct]] method, generate a runtime error.
    5. Call the [[Construct]] method on Result(2), providing no arguments (that is, an empty list of arguments).
    6. If Type(Result(5)) is not Object, generate a runtime error.
    7. Return Result(5).

    And then in §15.3.2.1 #18 the [[Construct]] method is explained (in the following, F is a newly constructed Function object):

    18. Set the [[Construct]] property of F to a method that, when it is invoked, constructs a new object whose [[Prototype]] property is equal
    to the value of F.prototype at the time the [[Construct]] method is
    invoked (but if this value is not an object then the value of
    Object.prototype is used), then invokes F as a function (using its
    [[Call]] property) with the new object as the this value and the
    arguments given to the [[Construct]] method as the arguments. If the
    result of invoking the [[Call]] method is an object, that object
    becomes the result of the invocation of the [[Construct]] method;
    otherwise the new object becomes the result of the invocation of the
    [[Construct]] method.

    So a constructor returning this by default has been in ECMAScript since the beginning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any reason to consider XHTML related details for web development for someone
Sorry for newbie question but is there a way to import someone else commit
I know this is a simple question for someone out there, but I have
This is a very rudimentary question, but I am sure someone out there knows
This is a very narrow and specific question, but I know there are someone
I thought the C/C++ vs C#/Java performance question was well trodden, meaning that I'd
Is there any facility in the standard Java libraries that, given a CharSequence, produces
I have a multi-part question: (1) Is there a good reason why Silverlight doesn't
Can someone give me 1 good reason why in C# the chained constructor is
I was just messing around to answer someone's question here on Stack Overflow, when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.