Skip to content

Instantly share code, notes, and snippets.

@qetr1ck-op
Created September 26, 2015 13:52
Show Gist options
  • Save qetr1ck-op/d20e3a520e4dc06a5f63 to your computer and use it in GitHub Desktop.
Save qetr1ck-op/d20e3a520e4dc06a5f63 to your computer and use it in GitHub Desktop.
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