Creative Commons License

Unless otherwise expressly stated, all original material of whatever nature created by and included in this weblog is licensed under a Creative Commons License.

Opera 9.25 vs Safari JavaScript syntax error forgiveness, 09.08.2008 01:15

The following definition of an Array works without problems in Safari (and probably Firefox too), but triggers an (legitimate) error in Opera 9.25:

var myArray = [





The error is triggered by the superfluous comma after the last element of the Array. It may be argued for both behaviors, but I would prefer all Browsers accepting such an Array definition also since in other languages (C, Python, PHP) such a redundant comma does not cause any trouble.

blog comments powered by Disqus