What's wrong with this code? I'm trying to extend the class foo with all the native array's functions.
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('-'));