这样不行,请问该怎样写?
<script type="text/javascript">
function shuzu(a,b,c){
Array.call(this,a,b,c)
}
shuzu.prototype=new Array();
arr1=new shuzu(1,2,3)
alert(arr1)
</script>
------解决方案--------------------
- JScript code
var myArray=function(){
var x=Array.apply(null,arguments);
for(var p in x)this[p]=x[p];
this.length=x.length;
};
myArray.prototype=new Array();
myArray.prototype.constructor=myArray;
------解决方案--------------------