[,] is a sparse array. It has a length of 1, but no values (0 in [,] === false). It can also be written as new Array(1).
[undefined] is an array of length 1 with the value undefined at index 0.
When accessing the property "0", both will return undefined - the first because that property is not defined, the second because the value is "undefined". However, the arrays are different, and so is their output in the console.