title: Something wrong when reset the javascript constructor
body: <p>I am trying to understand inheritance in javascript. 
  I wrote a basic example to implement a simple inheritance between the parent object and a child. But I think there is something wrong when resetting the constructor.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function Mammal(){
  }
  function Dog(){
  
  }
  Mammal.prototype.walk = function(){
      console.log('walking..walking....');
  }
  Dog.prototype.bark = function(){
      console.log('wof wof!');
  }
  
  Dog.prototype = Object.create(Mammal.prototype);
  Dog.prototype.constructor = Dog;
  let dogInstance = new Dog();
  dogInstance.walk();
  dogInstance.bark();</code></pre>
  </div>
  </div>
  </p>