Arrays in js can store various data types (values, strings)
The array in js does not cross the bounds. When the output array subscript exceeds the bounds, undefined will be displayed.
Arrays in js are dynamically grown by default
An easy way to traverse an array.
for(var key in arr){window.alert(key+"= "+arr[key]);}Problems arise when assigning values to an empty two-dimensional array:
var arr2=[];arr2[1][1]=45;//js does not support this assignment method
Solution:
//Before this, you need to initialize how many rows there are to define arr2. for(var i=0;i<5;i++){arr2[i]=[];}//This way you can assign a value to it. arr2[1][1]=45;