1.var arr = new Array(數(shù)值);
arr[0] = "值";
創(chuàng)建數(shù)組對象痹届,指定數(shù)組的個數(shù)君纫,然后通過下標(biāo)依次賦值
2.var arr = new Array("值","值",……);
創(chuàng)建數(shù)組對象共啃,直接賦值
3.var arr = ["值","值",……];
創(chuàng)建變量桩匪,通過中括號直接賦值
JavaScript可以給數(shù)組的下標(biāo)命名
arr["命名"] = "值";