[1,2,4,8][0,1,2,3]
// equals to 8 (the last element of the indexing array (3) becomes the index)
Why is this not a SyntaxError
error (a bad legacy or a purposeful feature)? (A possible duplicate, however I wasn't able to find an answer here.)
Update: Why the contents of the square brackets are treated as an expression
?