I was using inheritance and I noticed that there are three ways to get the same result. What\'s the difference?
function Animal(){
}
Animal.prototype.doThat
You could either use Solution 1 or Solution 2, but you should not use Solution 3.
The reason is when you do Bird.prototype = Animal.prototype;, every change on Bird.prototype will also affect Animal.prototype, because they the same object.
For example, you attach a method on Bird.prototype, then the method will also works on Animal, which will not be what you want.