You do not need to pre-determine the size of the array before assigning it. For instance:
var _array = []; _array[0] = "foo"; _array[1000] = "bar";
You do not need to initialize the appropriate number of array elements before assigning them.
Update
It has already been pointed out that you can use an object, not an array. However, if you want to use array methods, this is still possible. Let me give you an example:
var obj = { 0: 15, 1: 10, 2: 5, length: 3 };
If the object contains the length property, it can be considered as an object similar to an array. Although you cannot call array methods directly from these objects, you can use array methods.
Array.prototype.join.call( obj );
In fact, using the ECMAScript 5 map function, you can easily convert the above object into an array.
var _array = Array.prototype.map.call( obj, function( x ) { return x; } );
The display function does not exist in all browsers, but you can use the following function if it is not.
Array.map = Array.map || function(a, f, thisArg) { return Array.prototype.map.call(a, f, thisArg); }