Object.create Polyfill

Implement myObjectCreate(proto) — a polyfill for Object.create().

Object.create(proto) creates a new empty object whose [[Prototype]] is set to proto.

const animal = { eat() { return `${this.name} eats`; } };
const dog = myObjectCreate(animal);
dog.name = "Rex";
dog.eat(); // "Rex eats" — inherited from animal
Object.getPrototypeOf(dog) === animal; // true

The classic pre-ES5 implementation uses a temporary constructor function:

function F() {}
F.prototype = proto;
return new F();
Examples
Input: ["inherit","world"]
Output: "hello from world"
Hints

Object.create Polyfill

Implement myObjectCreate(proto, propertiesObject) — a polyfill for Object.create that creates a new object with the given prototype.