Closed MananTank closed 3 years ago
Replace Object.setPrototypeOf with Object.create for setting prototype of newly created object
Object.setPrototypeOf
Object.create
The purpose of those two lines is to show what's going on under the covers. Using Object.create(..) is shorter (and more efficient), but less illustrative.
Object.create(..)
Replace
Object.setPrototypeOf
withObject.create
for setting prototype of newly created object