I have seen some code with something like the following:
var thing=Object(stuff); // stuff is an object
where stuff is an object.
(I have seen this sort of code on Mozilla’s web site in a polyfill for Object.assign).
The documentation on Mozilla is not specific about what it means if the parameter is an object.
As far as I can tell, the new object is a reference to the original object. I thought that you would get the same if you simply wrote:
var thing=stuff; // stuff is an object
What is the difference between the two?
Edit
Do I need to say it? This is not a question about Object.assign. It’s a question about using the Object constructor.