const person = {
name: null
}
// create new object and set its __proto__ to point to person object
const ivan = Object.create(person);
// ivan will be an empty {} and can use the name property which it "inherits" from __proto__
// up to this point name is not ivan's own property, the lookup goes to person
Last active
December 25, 2018 17:12
-
-
Save ivankisyov/e0dbabe080ce691f9c7cf42884316c3c to your computer and use it in GitHub Desktop.
Object.create
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment