隐式创建
var arr=["Audi","BMW","Volvo"];
直接实例化
var arr=new Array("Audi","BMW","Volvo");
创建数组并给数组元素赋值
var arr=new Array();
arr[0]="Audi";
arr[1]="BMW";
arr[2]="Volvo";
注意:
console.log(arr.length); //
arr[4]='jeep';
console.log(arr.length); //
console.log(arr[3]); //undefined