- 471 名前:Name_Not_Found mailto:sage [2014/12/28(日) 22:42:49.38 ID:???.net]
- >>464
配列の初期長を決めて、あらかじめインスタンスを必要個数分だけ作っておくのはどう? function Foo(){ this.x = null; this.y = null; } function Array1(len){ for(var i=0;i<len;i++) this[i] = new Foo(); } var a = new Array1(8); //[0]~[7]のFooのインスタンス配列 a[3].x = 1; a[7].y = 2;
|
|