JavaScript · Middle · Question 7 of 75
What does Object.create(proto) do?
- ✓Correct answer: Creates a new empty object whose prototype is
proto - 2Creates a deep copy of the
protoobject with all its properties - 3Creates an instance of the
protoclass by calling its constructor
Explanation
The properties of proto aren't copied - they're accessible through the prototype chain. Object.create(null) creates an object with no prototype at all: a handy "clean" dictionary without inherited keys like toString.