new Object(base)
is not the same as Object.create(base)
.
new Object(x)
will box x
into an object.
In particular, new Object(base) === base
is true.
For more detail, see the spec:
- If value is supplied, then
- If Type(value) is Object, then
- If the value is a native ECMAScript object, do not create a new object but simply return value.