[,] creates an array with length of 1 and no indices.
[undefined] creates an array with length of 1 with undefined value at index 0.
Chrome's undefined × x is for sparse arrays that don't have sequential indices:
var a = [];
a[8] = void 0; //set the 8th index to undefined, this will make the array's length to be 9 as specified. The array is sparse
console.log(a) //Logs undefined × 8, undefined, which means there are 8 missing indices and then a value `undefined`
If you were to use .forEach on a sparse array, it skips the indices that don't exist.
a.forEach(function() {
console.log(true); //Only logs one true even though the array's length is 9
});
Where as if you do a normal .length based loop:
for (var i = 0; i < a.length; ++i) {
console.log(true); //will of course log 9 times because it's only .length based
}
There is a gotcha if you expect .forEach to behave the same as non-standard implementations.
new Array(50).forEach( function() {
//Not called, the array doesn't have any indices
});
$.each( new Array(50), function() {
//Typical custom implementation calls this 50 times
});