In JavaScript, the _______ method is used to create a new object using an existing object as the prototype of the newly created object.
- Object.create()
- Object.assign()
- Object.extend()
- Object.instantiate()
In JavaScript, the Object.create() method is used to create a new object with the specified prototype object. It allows you to create objects that inherit properties and methods from an existing object, making it a powerful tool for prototypal inheritance.
Loading...
Related Quiz
- Can a function expression be used before it is defined in the code?
- Which method would you use to add a new property to an object after it has been created?
- The method _________ is used to parse a JSON response in Fetch API.
- What is the main difference between function declaration and function expression in JavaScript?
- In JavaScript, the "this" keyword inside an arrow function is defined by its _________ context.