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?
If you look in ECMA-262 ed 1 (which is still available online from the ECMA site) you will see:
And then in §15.3.2.1 #18 the
[[Construct]]method is explained (in the following, F is a newly constructed Function object):So a constructor returning
thisby default has been in ECMAScript since the beginning.