定义数组有几种方法
//方法一
var arr1 = [1,3,5,7,9];
var
arr1 = [1,3,5,7,9];
//方法二
var arr2 = new Array(2,4,6,8,10);
arr2 =
new
Array(2,4,6,8,10);
//方法三
var arr3 = new Array(3);
arr3 =
Array(3);
//固定数组长度为3
arr3[0] = 1;arr3[1] = 2;arr3[2] = 3;
arr3[0] = 1;
arr3[1] = 2;
arr3[2] = 3;