新手求教,js中怎么定义数组存储的数据类型是自己定义的类型
function myType(x, y){
this.x = x;
this.y = y;
}
var array = new Array();
function myType(x, y){
this.x = x;
this.y = y;
}
var array = new Array();
array[0] = new myType(1,2);
array[1] = new myType(3,4);
array[3] = new myType(5,6);