I was recently bitten by a bug where there accidentally was one too many commas in a JavaScript array which brings us to todays question: Why is
[1, 2, , 4, 5]
a valid JavaScript array and not a syntax error? Is it clearly defined in the ECMAScript standard that emply elements should be allowed? It seems like such an easy typo to make.
For further information it can be noted that [1, 2, , 4, 5][2]; is undefined.