1. Simply create a JavaScript array:
Vararr=newarray ();
Important: Create an Array object with the New keyword array (), the array () object is a local class that can be created with the new object using the
2. Specify the array size while creating the JavaScript array:
Vararr=newarray (10);//This creates an array with an initial size of 10
Note: When using the array size operation to initialize the size, the array will automatically become large and will not have an error like the C language. Dynamic growth is a property of the JS array. In addition, JS supports a maximum array length of 4294967295
3. Direct initialization:
Vararr=newarray ("Paramecium", "Love", "fluffy");//This is directly initialized with an array or vararr=["Paramecium", "Love", "fluffy"];//parentheses can also declare an array object, of course, like the C language, You can also define 2-dimensional 3-and multidimensional arrays, which are not discussed here.
2. Create Array Direct volume
var a=[1,2,3,4,5];
var a=["string", "id", "it", true,3];
The direct amount of an array can also contain direct amounts of objects and other array direct quantities
Several ways that JavaScript creates arrays