javascript extending Array class
<p>What's wrong with this code? I'm trying to extend the class foo with all the native array's functions.</p>

<pre><code>function foo(){
    Array.call(this);
 }

foo.prototype.addFruit=function(item){
    this.unshift(item);
}
foo.prototype=new Array();
foo.prototype.constructor=foo;

var c =new foo();

c.addFruit('Apple');


document.write(c.join('-'));
​
</code></pre>
