I've seen a number of questions about new Object
vs new Object()
or new Object()
vs {}
, but I'm wondering about what the difference is between Object()
and new Object()
? In other words, what's the difference between calling the Object
constructor with new
vs not?
I've seen one other answer here on StackOverflow, but it's in regards to ES5. I'm wondering about for ES6?
I also ask because MDN on their page for the Object()
constructor states:
Note:
Object()
can be called with or withoutnew
, but sometimes with different effects. See Return value.
But under the "Return value" section on that page, I cannot discern what these "different effects" may be?