Created
September 26, 2015 13:52
-
-
Save qetr1ck-op/d20e3a520e4dc06a5f63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let animal = { | |
jumps: null | |
}; | |
let rabbit = { | |
jumps: true | |
}; | |
rabbit.__proto__ = animal; | |
console.log( rabbit.jumps ); // ? (1) | |
delete rabbit.jumps; | |
console.log( rabbit.jumps ); // ? (2) | |
delete animal.jumps; | |
console.log( rabbit.jumps ); // ? (3) | |
/* | |
(1) true, property from rabbit. | |
(2) null, property from animal. | |
(3) undefined, doesn't have a property. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment