94. implement your own `Object.create`

JavaScript
Is this helpful ?

medium  - accepted / - tried

You can use Object.create() to create a new object.

Can you write your own myObjectCreate() to do the same(well for the basic usage) ?

Note

  1. you don't need to support propertiesObject - 2nd parameter of Object.create
  2. throw an Error if non-object is passed in. (why?)
  3. Object.create() and Object.setPrototypeOf() should not be used.

Let's try to solve this problem within 10 mintues.

Discuss(12)