Back to the lesson

Where it writes?

importance: 5

We have rabbit inheriting from animal.

If we call, which object receives the full property: animal or rabbit?

let animal = {
  eat() {
    this.full = true;

let rabbit = {
  __proto__: animal

The answer: rabbit.

That’s because this is an object before the dot, so modifies rabbit.

Property lookup and execution are two different things. The method is first found in the prototype, then executed with this=rabbit