4 JavaScript 数组

7 JavaScript 数组
下面的代码创建名为 cars 的数组:

var cars=new Array();
cars[0]="Audi";
cars[1]="BMW";
cars[2]="Volvo";

或者 (condensed array):

var cars=new Array("Audi","BMW","Volvo");

或者 (literal array):
实例

var cars=["Audi","BMW","Volvo"];

你可能感兴趣的:(4 JavaScript 数组)