Skip to content

Something wrong in Prototypes, inheritance->F.prototype->Tasks #2600

@marshcat0

Description

@marshcat0

Link here
At the end, it says

At the end, we have let user2 = new Object('Pete'). The built-in Object constructor ignores arguments, it always creates an empty object, similar to let user2 = {}, that’s what we have in user2 after all.

but MDN says:

The Object constructor creates an object wrapper for the given value.
Test in Chrome:

未命名

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions