Using numbers as property names causes syntax errors

Atom RSS

This site heavily relies on bug reports created by its readers. Anyone can report a bug and be published.

Main navigation:




Search reports by browser:

When creating an object using the inline object syntax, it is possible to use numbers as property names:

var foo = {7:'bar'};

In Internet Explorer for Mac, this will throw a syntax error and cause the entire script to be ignored.

Test page Workaround is included
Reported by: TarquinWJ.

Explorer Mac | Reported on 29 June 2005.

Comments

(Add your own)

Post a comment

Commenting guidelines:

  1. When quoting specs, articles or your own research, please include a URL of the document.
  2. Test your stuff. When reporting browser behaviour, make sure that your report is correct.

Yes