Js声明数组的四种方法

//第一种
var A=[12,78,78,78,89]
console.log(A)

//第二种
var B=new Array();
B[0]=12
B[1]=34
B[2]=56
console.log(B)


//第三种
var C=new Array(3);
C[0]=12
C[1]=34
C[2]=56
console.log(C)


//第四种

var D=new Array(45,78,89,45);
console.log(D)

猜你喜欢

转载自blog.csdn.net/qq_39125445/article/details/88218907