The Array objects allow you to perform advanced array manipulations. The Array object can be created using the one of the following syntaxes:
var EmptyArray = new Array(); var TestArray = new Array(10); // create an empty array with 10 items var DaysArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); |
Array | Creates an empty array object. |
Array | Creates an array object with the specified number of items. |
Array | Creates an array object and fills it with the specified items. |
Push | Adds one or more items to the end of the array. |
Pop | Removes a last item from the array and returns it. |
Type (read only) | Returns always "array" |
Length | Gets or sets the current length of the array, deleting the extra items if necessary. |
[index] | You can set/get individual items of an array using the usual square bracket notation. |
Creates an empty array object.
Creates an array object with the specified number of items.
Creates an array object and fills it with the specified items.
Adds one or more items to the end of the array.
Returns the new length of the array.
Removes a last item from the array and returns it.
Returns the last item of the array.