The following case returns undefined
in Chrome devtools.
['test1', 'test2']['test3', 'test4']
.
I believe this may be because of automatic semicolon insertion, but this case I'm finding hard to understand when running in the Chrome devtools.
The following (and other permutations of ;
in different locations) returns the last item, ['test3', 'test4']
:
;['test', 'test2'];['test3', 'test4'];
I believe this case is different from the marked duplicate because the usage of the comma doesn't cause any of the individual items to be returned (it makes sense that 'test3','test4'
would return 'test4'
, but in this instance the commas are within the context of arrays).