extends javascript function inherits array
<p>I have some javascript code shown below</p>

<pre><code>function extends(Child, Parent) {
    var F = function() {
    };
    F.prototype = Parent.prototype;
    Child.prototype = new F();
    Child.prototype.constructor = Child;
}

function Parent() {
    this.cardArray = [];
}

function Child() {

}
</code></pre>

<p>then I call </p>

<pre><code>extends(Child , Parent);  
var a=new Child();
</code></pre>

<p>it reports</p>

<pre><code> a.cardArray is undefined
</code></pre>

<p>Your comment welcome</p>
