I know in javascript if I want define an array,I use:
var arr=new array();
However,this array could only use for store date,int,string,just the javascript already defined
Suppose I have already my custom datatype:
function LayerInfo(uuid, top, left, index, pindex) {
this.uuid = uuid;
this.top = top;
this.left = left;
this.index = index;
this.pindex = pindex;
}
How can I initialize an array which the data type is the “LayerInfo”,could store the “LayerInfo”?
like
var l=new LayerInfo()?
if this could be done ,how can I let the layerinfo push into the array,or pull it out?
Fortunately not,
arrcan store any object you like, including instances of yourLayerInfo: