how to use parent constructor? : <p>please help solve the problem. i have base class 'Unit':</p>

<pre><code>var Unit = function() { 
  this.x_coord = x_coord;
  this.y_coord = y_coord;
  this.color = color;
};
</code></pre>

<p>and child class 'playerUnit':</p>

<pre><code>var playerUnit = function(gameObj, x_coord, y_coord, color) { 
  Unit.apply(this, arguments);
};

playerUnit.prototype = Object.create(Unit.prototype);

var Game = function(options) {
  new playerUnit(this,1,1,'red');  
};

var app = new Game(); 
</code></pre>

<p>I plan in the future to do a lot of these child classes: 'enemyUnit', 'tankUnit', 'boatUnit', etc. and i need use common properties: x_coord, y_coord, color.</p>

<pre><code>i try use Unit.apply(this, arguments);
</code></pre>

<p>but after start script i have in console follow error message: </p>

<blockquote>
  <p>Uncaught ReferenceError: x_coord is not defined</p>
</blockquote>

<p>jsfiddle: <a href="https://jsfiddle.net/vzk73qah/2/" rel="nofollow">https://jsfiddle.net/vzk73qah/2/</a></p>
