title: How to extend existing constructor function in javascript?
body: <p>Let's suppose that I have the following object function:</p>
  
  <pre><code>function A(options){
   ...
  }
  </code></pre>
  
  <p>Then I want to create a new function (B) that inherits A's prototype. 
  These are the conditions I'm looking for: </p>
  
  <ul>
  <li>B's prototype, if modified, should not modify A's</li>
  <li>when calling to B function as a constructor, A's constructor should be called with the corresponding options.</li>
  </ul>
  
  <p>B should look like this:</p>
  
  <blockquote>
    <p>function B(aOptions, bOptions){ ... }</p>
  </blockquote>
  
  <pre><code>var b = new B({}, {})
  </code></pre>