title: Is there a difference between array and number datatype in Javascript prototypal inheritance?
body: <p>I am nerd in javascript prototypal inheritance.I can understand what happening in below code</p>
  
  <pre><code>function Hamster() {  }
  Hamster.prototype = {
    food: [],
    found: function(something) {
      this.food.push(something)
    }
  }
  
  // Create two speedy and lazy hamsters, then feed the first one
  speedy = new Hamster()
  lazy = new Hamster()
  
  speedy.found("apple")
  speedy.found("orange")
  
  alert(speedy.food.length) // 2
  </code></pre>
  
  <p>And below line is also alert <code>2</code> b'coz both object is sharing <code>food</code> array from <code>Hamster</code>'s prototype</p>
  
  <pre><code>alert(lazy.food.length) // 2
  </code></pre>
  
  <p>But if i change datatype of array into number , <code>food</code>  key is not sharing between both instances</p>
  
  <pre><code>function Hamster() {  }
  Hamster.prototype = {
    food: 0,
    found: function(something) {
      this.food = something
    }
  }
  
  // Create two speedy and lazy hamsters, then feed the first one
  speedy = new Hamster()
  lazy = new Hamster()
  
  speedy.found(123)
  
  
  alert(speedy.food) // 123
  </code></pre>
  
  <p>But the below line alerts <code>0</code> , Could you please tell me why this doesn't alert <code>123</code></p>
  
  <pre><code>alert(lazy.food) // 0
  </code></pre>