title: "this" keyword with Prototype JS
body: <p>I'm confused with the &quot;this&quot;keyword in JS. I understand that rabbit's prototype is animal and the &quot;this&quot; keyword in <code>rabbit.isSleeping</code> should refer to rabbit but I thought the <code>animal.isSleeping</code> should refer to animal I don't understand why it's undefined? Could someone explain?</p>
  <pre><code>let animal = {
    walk() {
      if (!this.isSleeping) {
        alert(`I walk`);
      }
    },
    sleep() {
      this.isSleeping = true;
    }
  };
  
  let rabbit = {
    name: &quot;White Rabbit&quot;,
    __proto__: animal
  };
  
  
  rabbit.sleep();
  
  alert(rabbit.isSleeping); // true
  alert(animal.isSleeping)
  </code></pre>