Function object (o ){
Function f (){}
F. Prototype = O;
Return new F ();
}
// You can create a new object based on an existing object by using the prototype without having to create a custom type for Chu,
// Within the object function, a temporary constructor is created, the input object is used as the prototype of the constructor, and the temporary type of constructor is returned.
// New instance. In essence, an object () performs a previous copy of the object in it.
VaR person = {
Name: "Nicolas ",
Friends: ["Shelby", "Count", "Wan"]
};
VaR anotherperson = Object (person );
Anotherperson. Name = "Greg ";
Anotherperson. Friends. Push ("Rob ");
VaR anotherperson2 = Object (person );
Anotherperson2.name = "greg2 ";
Anotherperson2.friends. Push ("rob2 ");
Console. Log (anotherperson2.friends );
// Inherit object. Create () to normalize the prototype ();
// When a parameter is input, it is the same as the object function.
VaR person = {
Name: "shalio ",
Friends: ["hahs", "Jk", "ll"]
};
VaR anotherperson = object. Create (person );
// You can also input two parameters for this method, which are similar to object. defineproperties.
VaR newperson = object. Create (person, {Name: {value: "hhhh "}});