> Le 27 juil. 2016 à 07:16, Jordan Harband <[email protected]> a écrit :
>
> `new weirdFunction()` would `=== iter` because a constructor that returns an
> object (`this`), returns that object when `new`ed - which is how functions
> have worked since ES3 (or probably ES1).
If `weirdFunction` were defined as if by evaluating `function () { return this
}`, yes. But in general, functions are not necessarily constructors (just try
`new Math.sin` in your favourite JS environment).
—Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss