JavaScript Object.create() MethodThe Object.create() method is used to create a new object with the specified prototype object and properties. We can create an object without a prototype by Object.creates (null). Syntax:Parameterprototype: It is the prototype object from which a new object has to be created. propertiesObject: It is an optional parameter. It specifies the enumerable properties to be added to the newly created object. ReturnObject.create() returns a new object with the specified prototype object and properties. Browser Support:
Example 1Output: "My name Marry. Am I human? true" Example 2Output: "franco" Example 3Output: "fruit" "Winter" "Winter" Next TopicJavaScript Objects |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India