Answer Posted / Saurabh Pratap Singh
[n {n "description": "object.create() is a JavaScript method that creates a new object and makes the newly created object a prototype of an existing object.n ",n "example": "n let proto = {"a": 1};n let obj = Object.create(proto);n console.log(obj.a); // Outputs: 1"n },n {n "description": "object.create() can also accept a second argument, propertiesObject, to set initial values for the new object.n ",n "example": "n let proto = {"a": 1};n let obj = Object.create(proto, {"b": {"value": 2, "writable": true}});n console.log(obj.b); // Outputs: 2"n }n]
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category