What is Object.create()?
Creates a new object with the specified prototype object.
Example:
const parent = { greet() { console.log("Hello"); } };
const child = Object.create(parent);
child.greet(); // Hello
Creates a new object with the specified prototype object.
Example:
const parent = { greet() { console.log("Hello"); } };
const child = Object.create(parent);
child.greet(); // Hello