title: What is the equivalent of inheritance and extends keyword in JavaScript constructor functions?
body: <p>I'm new to JavaScript and prototype-based programming. I know you can define inherited classes like <code>class Circle extends Shape {}</code>, but <code>class</code> is mostly a syntactic sugar of constructor functions, so is there any equivalent for inheritance of functions in JavaScript?</p>
  <p>In other words, how can I define an inherited function without <code>class</code> keyword, like this:</p>
  <pre><code>var Shape = function() {
    this.getColor = function() {alert('Some color!')};
  };
  
  //Something like this:
  var Circle = Function.create(Shape);
  
  var circle1 = new Circle;
  
  //With all below conditions:
  console.log(Circle.__proto__ == Shape)                     // true
  console.log(Circle.prototype.__proto__ == Shape.prototype) // true
  console.log(circle1 instanceof Shape)                      // true
  console.log(Object.getOwnPropertyNames(circle1))           // Array [ &quot;getColor&quot; ]
  </code></pre>
  <p>I've searched some articles but last condition wasn't achieved in them and <code>getColor</code> was an inherited property, rather than being a member of the <code>circle1</code> itself.</p>