Loading challenge...
Preparing the challenge details...
Loading challenge...
Preparing the challenge details...
Implement Object.create using the classic empty-constructor trick to set an object's prototype chain.
Object.create makes a new object whose [[Prototype]] is set to the argument you pass in. The standard interview answer uses an empty constructor function: set F.prototype = proto, then call new F(). The caveat worth mentioning: this trick cannot truly produce a null-prototype object like Object.setPrototypeOf can.
Goal: Implement Object.myCreate with the empty-constructor trick and support for propertiesObject.
Continue learning with these related challenges
Implement Object.assign from scratch: copy own enumerable properties (including Symbols) from sources onto the target.
Implement a function that recursively traverses an object, evaluates functions with given arguments, and transforms keys to lowercase. Master recursive object traversal and type checking.
Implement your own Promise.all polyfill to understand how concurrent Promise handling works under the hood.
Implement Object.assign from scratch: copy own enumerable properties (including Symbols) from sources onto the target.
Implement a function that recursively traverses an object, evaluates functions with given arguments, and transforms keys to lowercase. Master recursive object traversal and type checking.
Implement your own Promise.all polyfill to understand how concurrent Promise handling works under the hood.