定義對象: 二維對象數組: 多維數組: 任意類型數組: 泛型類: ...
定義對象:
namespace entity{
export class MyClass{
public value:number;
public rect:string;
public constructor(){
}
}
}
二維對象數組:
let myClass= new Array<Array<entity.MyClass>>();
多維數組:
let myArray: number[][][][] = []
任意類型數組:
let myArray:any[]=[]; myArray[0]=[{key:1,keyA:"a"},[1,2]]; let arr = [{key:1,keyA:"a"},[1,2]];
泛型類:
namespace entity{ export class MyClass<T>{ public myArray:T[]; public constructor(){ } } }